From: Eric Blake Date: Mon, 22 Mar 2010 20:01:55 +0000 (-0600) Subject: gethostname: further tweaks X-Git-Tag: v0.1~4444 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=7bacd338464a463f3ba0c14effd86b71ce3672b4;p=gnulib.git gethostname: further tweaks * lib/unistd.in.h (includes): Only worry about if we are overriding gethostname. Suggested by Bruno Haible. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 28a1f4610..8e31e9a48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-03-22 Eric Blake + + gethostname: further tweaks + * lib/unistd.in.h (includes): Only worry about if we + are overriding gethostname. + Suggested by Bruno Haible. + 2010-03-21 Bruno Haible Fix comments. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index beef6b05c..a60d4835d 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -19,8 +19,8 @@ - On mingw, several headers, including , include , but we need to ensure that both the system and are completely included before we replace gethostname. */ -#if @UNISTD_H_HAVE_WINSOCK2_H@ && !defined _GL_WINSOCK2_H_WITNESS \ - && defined _WINSOCK2_H +#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ + && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H /* is being indirectly included for the first time from ; avoid declaring any overrides. */ # if @HAVE_UNISTD_H@ @@ -43,7 +43,8 @@ #endif /* Get all possible declarations of gethostname(). */ -#if @UNISTD_H_HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H +#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ + && !defined _GL_INCLUDING_WINSOCK2_H # define _GL_INCLUDING_WINSOCK2_H # include # undef _GL_INCLUDING_WINSOCK2_H