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 98ea48c..72c649f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 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.
        * tests/macros.h: New file.
        * tests/test-areadlink.c: Include macros.h. Don't include <stdio.h>
index 2965629..18ff65c 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 dfcb54e..f7f6a7e 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 1fb2d94..3a20473 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@