changeset 12548:efe1df275da6

Avoid namespace pollution on glibc systems.
author Bruno Haible <bruno@clisp.org>
date Thu, 31 Dec 2009 22:54:32 +0100
parents 6d50d2a81c7d
children 50354c6024c8
files ChangeLog lib/spawn.in.h lib/sys_times.in.h lib/wchar.in.h
diffstat 4 files changed, 27 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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.
--- a/lib/spawn.in.h
+++ b/lib/spawn.in.h
@@ -29,8 +29,13 @@
 #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
--- a/lib/sys_times.in.h
+++ b/lib/sys_times.in.h
@@ -32,8 +32,11 @@
 
 # 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.  */
 
--- a/lib/wchar.in.h
+++ b/lib/wchar.in.h
@@ -55,10 +55,13 @@
 /* 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.  */