This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] libiberty: add HAVE_CONFIG_H check to all files (lacking it already)


Most of the files in libiberty protect the config.h include with a
HAVE_CONFIG_H check, but some don't.  So add it to all the files that
are missing it.  I noticed when I tried hand compiling a few files
while testing things but didn't have a config.h locally.  Can't see
anything wrong with this, but posting in case I missed something
obvious.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2010-08-14  Mike Frysinger  <vapier@gentoo.org>

	* libiberty/atexit.c, libiberty/bsearch.c, libiberty/clock.c,
	libiberty/_doprnt.c, libiberty/getcwd.c, libiberty/getpagesize.c,
	libiberty/getruntime.c, libiberty/gettimeofday.c, libiberty/lrealpath.c,
	libiberty/memmem.c, libiberty/objalloc.c, libiberty/pex-common.c,
	libiberty/pex-common.h, libiberty/pexecute.c, libiberty/pex-one.c,
	libiberty/pex-unix.c, libiberty/sha1.c, libiberty/strerror.c,
	libiberty/strsignal.c, libiberty/vsnprintf.c, libiberty/xstrerror.c:
	Add HAVE_CONFIG_H ifdef check.
---
 libiberty/_doprnt.c      |    2 ++
 libiberty/atexit.c       |    2 ++
 libiberty/bsearch.c      |    2 ++
 libiberty/clock.c        |    2 ++
 libiberty/getcwd.c       |    2 ++
 libiberty/getpagesize.c  |    2 ++
 libiberty/getruntime.c   |    2 ++
 libiberty/gettimeofday.c |    2 ++
 libiberty/lrealpath.c    |    2 ++
 libiberty/memmem.c       |    2 ++
 libiberty/objalloc.c     |    2 ++
 libiberty/pex-common.c   |    2 ++
 libiberty/pex-common.h   |    2 ++
 libiberty/pex-one.c      |    2 ++
 libiberty/pex-unix.c     |    2 ++
 libiberty/pexecute.c     |    2 ++
 libiberty/sha1.c         |    2 ++
 libiberty/strerror.c     |    2 ++
 libiberty/strsignal.c    |    2 ++
 libiberty/vsnprintf.c    |    2 ++
 libiberty/xstrerror.c    |    2 ++
 21 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/libiberty/_doprnt.c b/libiberty/_doprnt.c
index ca97bc8..460a8cd 100644
--- a/libiberty/_doprnt.c
+++ b/libiberty/_doprnt.c
@@ -16,7 +16,9 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "ansidecl.h"
 #include "safe-ctype.h"
 
diff --git a/libiberty/atexit.c b/libiberty/atexit.c
index e091f01..d99180a 100644
--- a/libiberty/atexit.c
+++ b/libiberty/atexit.c
@@ -11,7 +11,9 @@ Causes function @var{f} to be called at exit.  Returns 0.
 
 */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #ifdef HAVE_ON_EXIT
 
diff --git a/libiberty/bsearch.c b/libiberty/bsearch.c
index 771d5de..24ff023 100644
--- a/libiberty/bsearch.c
+++ b/libiberty/bsearch.c
@@ -45,7 +45,9 @@ is respectively less than, matching, or greater than the array member.
 
 */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "ansidecl.h"
 #include <sys/types.h>		/* size_t */
 #include <stdio.h>
diff --git a/libiberty/clock.c b/libiberty/clock.c
index 07d902e..336f114 100644
--- a/libiberty/clock.c
+++ b/libiberty/clock.c
@@ -34,7 +34,9 @@ number of seconds used.
 
 */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #ifdef HAVE_GETRUSAGE
 #include <sys/time.h>
diff --git a/libiberty/getcwd.c b/libiberty/getcwd.c
index 28f26eb..795e09e 100644
--- a/libiberty/getcwd.c
+++ b/libiberty/getcwd.c
@@ -17,7 +17,9 @@ directory's path doesn't fit in @var{len} characters, the result is
 
 */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
diff --git a/libiberty/getpagesize.c b/libiberty/getpagesize.c
index 1c3a263..18d2b79 100644
--- a/libiberty/getpagesize.c
+++ b/libiberty/getpagesize.c
@@ -22,7 +22,9 @@ BUGS
 
 #ifndef VMS
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c
index 82f3d2e..35e70bd 100644
--- a/libiberty/getruntime.c
+++ b/libiberty/getruntime.c
@@ -17,7 +17,9 @@ License along with libiberty; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #include "ansidecl.h"
 #include "libiberty.h"
diff --git a/libiberty/gettimeofday.c b/libiberty/gettimeofday.c
index fca1679..b6e4c69 100644
--- a/libiberty/gettimeofday.c
+++ b/libiberty/gettimeofday.c
@@ -1,4 +1,6 @@
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "libiberty.h"
 #ifdef HAVE_TIME_H
 #include <time.h>
diff --git a/libiberty/lrealpath.c b/libiberty/lrealpath.c
index b27c8de..89dc0ef 100644
--- a/libiberty/lrealpath.c
+++ b/libiberty/lrealpath.c
@@ -33,7 +33,9 @@ components will be simplified.  The returned value will be allocated using
 
 */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "ansidecl.h"
 #include "libiberty.h"
 
diff --git a/libiberty/memmem.c b/libiberty/memmem.c
index 5d75599..689a539 100644
--- a/libiberty/memmem.c
+++ b/libiberty/memmem.c
@@ -27,9 +27,11 @@ Returns @code{NULL} if not found.
 
 */
 
+#ifdef HAVE_CONFIG_H
 #ifndef _LIBC
 # include <config.h>
 #endif
+#endif
 
 #include <stddef.h>
 #include <string.h>
diff --git a/libiberty/objalloc.c b/libiberty/objalloc.c
index 3ddac2c..ca2f0cf 100644
--- a/libiberty/objalloc.c
+++ b/libiberty/objalloc.c
@@ -17,7 +17,9 @@ along with this program; if not, write to the Free Software
 Foundation, 51 Franklin Street - Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "ansidecl.h"
 
 #include "objalloc.h"
diff --git a/libiberty/pex-common.c b/libiberty/pex-common.c
index 9a9fe24..1f5a945 100644
--- a/libiberty/pex-common.c
+++ b/libiberty/pex-common.c
@@ -18,7 +18,9 @@ License along with libiberty; see the file COPYING.LIB.  If not,
 write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "libiberty.h"
 #include "pex-common.h"
 
diff --git a/libiberty/pex-common.h b/libiberty/pex-common.h
index af338e6..3b6cb70 100644
--- a/libiberty/pex-common.h
+++ b/libiberty/pex-common.h
@@ -22,7 +22,9 @@ Boston, MA 02110-1301, USA.  */
 #ifndef PEX_COMMON_H
 #define PEX_COMMON_H
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "libiberty.h"
 #include <stdio.h>
 
diff --git a/libiberty/pex-one.c b/libiberty/pex-one.c
index 696b8bc..959bc3c 100644
--- a/libiberty/pex-one.c
+++ b/libiberty/pex-one.c
@@ -17,7 +17,9 @@ License along with libiberty; see the file COPYING.LIB.  If not,
 write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "libiberty.h"
 
 const char *
diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
index 85733a6..0657351 100644
--- a/libiberty/pex-unix.c
+++ b/libiberty/pex-unix.c
@@ -20,7 +20,9 @@ License along with libiberty; see the file COPYING.LIB.  If not,
 write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "libiberty.h"
 #include "pex-common.h"
 
diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c
index 97f1574..c11d6a1 100644
--- a/libiberty/pexecute.c
+++ b/libiberty/pexecute.c
@@ -22,7 +22,9 @@ Boston, MA 02110-1301, USA.  */
    pex_init/pex_run/pex_get_status/pex_free routines.  Don't use
    pexecute in new code.  Use the newer routines instead.  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "libiberty.h"
 
 #ifdef HAVE_STDLIB_H
diff --git a/libiberty/sha1.c b/libiberty/sha1.c
index 6a25ab2..89a9169 100644
--- a/libiberty/sha1.c
+++ b/libiberty/sha1.c
@@ -23,7 +23,9 @@
       Robert Klep <robert@ilse.nl>  -- Expansion function fix
 */
 
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#endif
 
 #include "sha1.h"
 
diff --git a/libiberty/strerror.c b/libiberty/strerror.c
index 0efadc3..1b94e00 100644
--- a/libiberty/strerror.c
+++ b/libiberty/strerror.c
@@ -2,7 +2,9 @@
    Written by Fred Fish.  fnf@cygnus.com
    This file is in the public domain.  --Per Bothner.  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #ifdef HAVE_SYS_ERRLIST
 /* Note that errno.h (not sure what OS) or stdio.h (BSD 4.4, at least)
diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c
index 666b1b4..e10ae26 100644
--- a/libiberty/strsignal.c
+++ b/libiberty/strsignal.c
@@ -2,7 +2,9 @@
    Written by Fred Fish.  fnf@cygnus.com
    This file is in the public domain.  */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "ansidecl.h"
 #include "libiberty.h"
 
diff --git a/libiberty/vsnprintf.c b/libiberty/vsnprintf.c
index 5470df2..0fdfc9a 100644
--- a/libiberty/vsnprintf.c
+++ b/libiberty/vsnprintf.c
@@ -41,7 +41,9 @@ used.
 
 */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "ansidecl.h"
 
 #include <stdarg.h>
diff --git a/libiberty/xstrerror.c b/libiberty/xstrerror.c
index 2ea2200..5bb2525 100644
--- a/libiberty/xstrerror.c
+++ b/libiberty/xstrerror.c
@@ -15,7 +15,9 @@ will never return a @code{NULL} pointer.
 
 #include <stdio.h>
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "libiberty.h"
 
 #ifdef VMS
-- 
1.7.1.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]