This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

[COMMITTED PATCH] Clean up HAVE_CONFIG_H and STDC_HEADERS.


This change gets rid of -Wundef warnings for these two macros.
Verified on x86_64-linux-gnu and i686-linux-gnu that no code changes.


	* include/libc-symbols.h (HAVE_CONFIG_H, STDC_HEADERS): New macros.
	* catgets/Makefile (catgets-CPPFLAGS): Remove -DHAVE_CONFIG_H.
	* locale/Makefile (CPPFLAGS-locale-programs): Likewise.
	* stdlib/strtol_l.c [_LIBC] (STDC_HEADERS): Don't define it.

--- a/catgets/Makefile
+++ b/catgets/Makefile
@@ -46,8 +46,7 @@ include ../Rules
 
 $(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o)
 
-catgets-CPPFLAGS := -DNLSPATH='"$(msgcatdir)/%L/%N:$(msgcatdir)/%L/LC_MESSAGES/%N:$(msgcatdir)/%l/%N:$(msgcatdir)/%l/LC_MESSAGES/%N:"' \
-	    -DHAVE_CONFIG_H
+catgets-CPPFLAGS := -DNLSPATH='"$(msgcatdir)/%L/%N:$(msgcatdir)/%L/LC_MESSAGES/%N:$(msgcatdir)/%l/%N:$(msgcatdir)/%l/LC_MESSAGES/%N:"'
 
 CPPFLAGS-gencat = -DNOT_IN_libc
 
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -48,6 +48,19 @@
 
 #include <config.h>
 
+/* Define this for the benefit of portable GNU code that wants to check it.
+   Code that checks with #if will not #include <config.h> again, since we've
+   already done it (and this file is implicitly included in every compile,
+   via -include).  Code that checks with #ifdef will #include <config.h>,
+   but that file should always be idempotent (i.e., it's just #define/#undef
+   and nothing else anywhere should be changing the macro state it touches),
+   so it's harmless.  */
+#define HAVE_CONFIG_H	0
+
+/* Define this for the benefit of portable GNU code that wants to check it.
+   Of course, it's never false when building libc!  */
+#define STDC_HEADERS	1
+
 /* The symbols in all the user (non-_) macros are C symbols.  */
 
 #if !defined HAVE_ASM_WEAK_DIRECTIVE && !defined HAVE_ASM_WEAKEXT_DIRECTIVE
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -89,7 +89,7 @@ CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
 			   -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
 			   -DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \
 			   -DLOCSRCDIR='"$(i18ndir)/locales"' \
-			   -DHAVE_CONFIG_H -DNOT_IN_libc
+			   -DNOT_IN_libc
 
 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
--- a/stdlib/strtol_l.c
+++ b/stdlib/strtol_l.c
@@ -24,7 +24,6 @@
 
 #ifdef _LIBC
 # define USE_NUMBER_GROUPING
-# define STDC_HEADERS
 # define HAVE_LIMITS_H
 #endif
 


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