From a4c6c61e4b224834f9b6a51fce16f3adbe1d982e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 7 Oct 2010 00:52:15 +0200 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ lib/string.in.h | 4 ++-- lib/sys_select.in.h | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19b5be831..643cc441b 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 6b848955a..879e06d9c 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 8f4fa0268..f9b850ceb 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 -- 2.11.0