Commit 339096647215cb4a675239020ec247b6031fce1f

Eric Blake 2010-03-19T16:57:28

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>