Avoid namespace pollution on glibc systems.
authorBruno Haible <bruno@clisp.org>
Thu, 31 Dec 2009 21:54:32 +0000 (22:54 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 31 Dec 2009 21:54:32 +0000 (22:54 +0100)
ChangeLog
lib/spawn.in.h
lib/sys_times.in.h
lib/wchar.in.h

index a318cae..b43a6e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-12-31  Bruno Haible  <bruno@clisp.org>
 
+       Avoid namespace pollution on glibc systems.
+       * lib/spawn.in.h: Don't include <sched.h>, <signal.h> on glibc systems.
+       * lib/sys_times.in.h: Don't include <time.h> on glibc systems.
+       * lib/wchar.in.h: Don't include <stddef.h>, <stdio.h>, <time.h> on
+       glibc systems.
+
+2009-12-31  Bruno Haible  <bruno@clisp.org>
+
        * m4/wchar.m4 (gl_WCHAR_H): Remove gl_STDDEF_H invocation.
        (gl_REPLACE_WCHAR_H): Turn into a no-op.
        * m4/arpa_inet_h.m4 (gl_REPLACE_ARPA_INET_H): Likewise.
index 3c42bfa..5a7633c 100644 (file)
 #ifndef _GL_SPAWN_H
 #define _GL_SPAWN_H
 
-#include <sched.h>
-#include <signal.h>
+/* Get definitions of 'struct sched_param' and 'sigset_t'.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <sched.h>
+# include <signal.h>
+#endif
+
 #include <sys/types.h>
 
 #ifndef __THROW
index 31ab4ce..34aa281 100644 (file)
 
 # define _GL_SYS_TIMES_H
 
-/* Get clock_t. */
-# include <time.h>
+/* Get clock_t.
+   But avoid namespace pollution on glibc systems.  */
+# ifndef __GLIBC__
+#  include <time.h>
+# endif
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
index d7e798b..d58c264 100644 (file)
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-   included before <wchar.h>.  */
-#include <stddef.h>
-#include <stdio.h>
-#include <time.h>
+   included before <wchar.h>.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
 
 /* Include the original <wchar.h> if it exists.
    Some builds of uClibc lack it.  */