Avoid future namespace pollution on glibc systems.
authorBruno Haible <bruno@clisp.org>
Thu, 24 Dec 2009 20:46:04 +0000 (21:46 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 24 Dec 2009 20:46:04 +0000 (21:46 +0100)
ChangeLog
lib/arpa_inet.in.h
lib/sys_ioctl.in.h
lib/sys_select.in.h

index 98ea48cce9e85c58502ff0491aa3392886b6d1f6..72c649f2ef64bfc0d7ab754ea939144e2716e573 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-12-24  Bruno Haible  <bruno@clisp.org>
+
+       Avoid future namespace pollution on glibc systems.
+       * lib/arpa_inet.in.h: Don't include <sys/socket.h> on glibc systems.
+       * lib/sys_ioctl.in.h: Don't include <unistd.h> on glibc systems.
+       * lib/sys_select.in.h: Don't include <sys/time.h> and <string.h> on
+       glibc systems.
+
 2009-12-24  Bruno Haible  <bruno@clisp.org>
 
        Refactor common macros used in tests.
index 296562920124898d67b77ce6676c9aaa41ac0e20..18ff65c412936f530bbdd1e4b35e955be2b42a0f 100644 (file)
 #ifndef _GL_ARPA_INET_H
 
 /* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
-   under MinGW. */
-#include <sys/socket.h>
+   under MinGW.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <sys/socket.h>
+#endif
 
 #if @HAVE_ARPA_INET_H@
 
index dfcb54e1a447be601239438c7081a74f9c5ce02d..f7f6a7e76e7fc314911fbffc21366baae5f63be2 100644 (file)
 #define _GL_SYS_IOCTL_H
 
 /* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
-   but not in <sys/ioctl.h>.  */
-#include <unistd.h>
+   but not in <sys/ioctl.h>.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <unistd.h>
+#endif
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
index 1fb2d946f683c612de724af1767e2ccf52546420..3a20473e01c93a8780383207263f323772f941fa 100644 (file)
 # include <sys/types.h>
 
 /* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
-   of 'struct timeval', and no definition of this type.  */
-# include <sys/time.h>
+   of 'struct timeval', and no definition of this type.
+   But avoid namespace pollution on glibc systems.  */
+# ifndef __GLIBC__
+#  include <sys/time.h>
+# endif
 
 /* On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
-   that relies on memset(), but without including <string.h>.  */
-# include <string.h>
+   that relies on memset(), but without including <string.h>.
+   But avoid namespace pollution on glibc systems.  */
+# ifndef __GLIBC__
+#  include <string.h>
+# endif
 
 /* The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@