bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCHv4] gethostname: fix build on mingw


From: Eric Blake
Subject: Re: [PATCHv4] gethostname: fix build on mingw
Date: Mon, 22 Mar 2010 11:46:53 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3

On 03/22/2010 11:39 AM, Simon Josefsson wrote:
> Eric Blake <address@hidden> writes:
> 
>> 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.
> 
> Testing the patch like this:
> 
> rm -rf m && gnulib-tool --create-testdir --dir m  getsubopt  gethostname && 
> cd m && ./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu && make 
> check
> 
> results in:
> 
> make[3]: Entering directory `/home/jas/src/gnulib/m/gllib'
> i586-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT close-hook.o -MD 
> -MP -MF .deps/close-hook.Tpo -c -o close-hook.o close-hook.c
> In file included from close-hook.c:24:
> ./unistd.h:27:6: error: token "@" is not valid in preprocessor expressions

Typo on line 26.

diff --git i/lib/unistd.in.h w/lib/unistd.in.h
index 28930cb..beef6b0 100644
--- i/lib/unistd.in.h
+++ w/lib/unistd.in.h
@@ -23,7 +23,7 @@
   && defined _WINSOCK2_H
 /* <unistd.h> is being indirectly included for the first time from
    <winsock2.h>; avoid declaring any overrides.  */
-# if @HAVE_UNISTD_H
+# if @HAVE_UNISTD_H@
 #  @INCLUDE_NEXT@ @NEXT_UNISTD_H@
 # else
 #  error unexpected; report this to address@hidden


-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]