gethostname: fix build on mingw
authorEric Blake <eblake@redhat.com>
Fri, 19 Mar 2010 22:57:28 +0000 (16:57 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 22 Mar 2010 17:51:00 +0000 (11:51 -0600)
commit339096647215cb4a675239020ec247b6031fce1f
treef38e678784e469cd787115dbe2470459c4a4c4c8
parenteb8d73f9107decfddc7de65c4d3ba55b85850b8e
gethostname: fix build on mingw

Since commit 4e86671a, gethostname failed to compile on mingw.
Gnulib's sys/socket.h includes winsock2.h, which then includes
unistd.h prior to declaring gethostname.  The fix is to ensure
that our replacement unistd.h does not declare any replacements
until we are sure that winsock2.h is completely included.

* lib/unistd.in.h (includes): Work around fact that mingw
<winsock2.h> re-includes <unistd.h>, by avoiding any
redeclarations if we are being included by <winsock2.h>.
Reported by Matthias Bolte.

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