gethostname: further tweaks
authorEric Blake <eblake@redhat.com>
Mon, 22 Mar 2010 20:01:55 +0000 (14:01 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 22 Mar 2010 20:22:13 +0000 (14:22 -0600)
* lib/unistd.in.h (includes): Only worry about <winsock2.h> if we
are overriding gethostname.
Suggested by Bruno Haible.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/unistd.in.h

index 28a1f46..8e31e9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-22  Eric Blake  <eblake@redhat.com>
+
+       gethostname: further tweaks
+       * lib/unistd.in.h (includes): Only worry about <winsock2.h> if we
+       are overriding gethostname.
+       Suggested by Bruno Haible.
+
 2010-03-21  Bruno Haible  <bruno@clisp.org>
 
        Fix comments.
index beef6b0..a60d483 100644 (file)
@@ -19,8 +19,8 @@
    - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
      but we need to ensure that both the system <unistd.h> and <winsock2.h>
      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
 /* <unistd.h> is being indirectly included for the first time from
    <winsock2.h>; 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 <winsock2.h>
 # undef _GL_INCLUDING_WINSOCK2_H