[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replace gai_strerror on mingw?
From: |
Eric Blake |
Subject: |
Re: replace gai_strerror on mingw? |
Date: |
Fri, 29 Apr 2011 07:46:51 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9 |
On 04/29/2011 01:17 AM, Simon Josefsson wrote:
>> test-getaddrinfo.c:28:1: warning: initialization from incompatible
>> pointer type
>
> Improving this seems like a good idea to me.
>
> Couldn't you use the same approach as getaddrinfo.c does to find the
> function? Mingw's inline prototype seems unfortunate, and I'm not sure
> why it works that way -- I believe gai_strerror is a real function on
> Windows.
In mingw (I'm not sure how it would be with native headers), the
<ws2tcpip.h> header has an inline definition of gai_strerrorA and
gai_strerrorW, then does #define gai_strerror gai_strerrorA (or W).
That is, I don't think you can link against gai_strerror, which is why
the m4 file uses AC_CHECK_DECLS rather than AC_REPLACE_FUNC.
>
> Also, there IS a lib/gai_strerror.c, isn't it used?
Prior to this thread, not on mingw - we were using the Windows version
as-is.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature