From: Bruno Haible Date: Wed, 6 Oct 2010 22:52:15 +0000 (+0200) Subject: string, sys_select: Avoid #including large headers unless necessary. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4c6c61e4b224834f9b6a51fce16f3adbe1d982e;p=pspp string, sys_select: Avoid #including large headers unless necessary. * lib/string.in.h: Don't include except on NetBSD. * lib/sys_select.in.h: Don't include except on Solaris, OSF/1, BeOS, Haiku. Reported by Jim Meyering. --- diff --git a/ChangeLog b/ChangeLog index 19b5be8314..643cc441bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-10-06 Bruno Haible + + string, sys_select: Avoid #including large headers unless necessary. + * lib/string.in.h: Don't include except on NetBSD. + * lib/sys_select.in.h: Don't include except on Solaris, + OSF/1, BeOS, Haiku. + Reported by Jim Meyering. + 2010-10-05 Eric Blake memmem, strstr, strcasestr: fix bug with long periodic needle diff --git a/lib/string.in.h b/lib/string.in.h index 6b848955a8..879e06d9cc 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -51,8 +51,8 @@ #endif /* NetBSD 5.0 declares strsignal in , not in . */ -/* But avoid namespace pollution on glibc systems. */ -#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) \ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \ && ! defined __GLIBC__ # include #endif diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index 8f4fa0268c..f9b850cebf 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -51,8 +51,9 @@ /* On Solaris 10, provides an FD_ZERO implementation that relies on memset(), but without including . - But avoid namespace pollution on glibc systems. */ -# ifndef __GLIBC__ + But in any case avoid namespace pollution on glibc systems. */ +# if (defined __sun || defined __osf__ || defined __BEOS__) \ + && ! defined __GLIBC__ # include # endif