Mercurial > hg > octave-kai > gnulib-hg
changeset 12497:e2d59f164e76
Avoid future namespace pollution on glibc systems.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 24 Dec 2009 21:46:04 +0100 |
parents | a48d3d749ca5 |
children | 7aad334c08d7 |
files | ChangeLog lib/arpa_inet.in.h lib/sys_ioctl.in.h lib/sys_select.in.h |
diffstat | 4 files changed, 28 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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.
--- a/lib/arpa_inet.in.h +++ b/lib/arpa_inet.in.h @@ -19,8 +19,11 @@ #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@
--- a/lib/sys_ioctl.in.h +++ b/lib/sys_ioctl.in.h @@ -30,8 +30,11 @@ #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. */
--- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -42,12 +42,18 @@ # 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@