bug-gnulib
[Top][All Lists]
Advanced

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

Re: MinGW gai_strerror conflict


From: Simon Josefsson
Subject: Re: MinGW gai_strerror conflict
Date: Wed, 17 Jan 2007 13:57:11 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux)

Yoann Vandoorselaere <address@hidden> writes:

> Hi,
>
> This occur when trying to compile the getaddrinfo() module under MinGW:
>
> checking for library containing getaddrinfo... no
> checking for getaddrinfo... no
> checking for getaddrinfo in ws2tcpip.h and -lws2_32... yes
> checking for gai_strerror... no
> [...]
> checking whether gai_strerror is declared... yes
>
>
> gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall
> -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> -Wbad-function-cast -Wcast-qual -Wcast-align -Wnested-externs -Wunused
> -MT gai_strerror.lo -MD -MP -MF .deps/gai_strerror.Tpo -c gai_strerror.c
> -DDLL_EXPORT -DPIC -o .libs/gai_strerror.o
> gai_strerror.c:68: conflicting types for `gai_strerrorA'
> c:/MinGW/include/ws2tcpip.h:301: previous declaration of `gai_strerrorA'

I don't get the same, I get:

http://autobuild.josefsson.org/gnulib-mingw32/log-200701171211588110000.txt

(Disregard the first ./configure output, it uses native cc.)

> The definition in ws2tcpip.h look like:
>
> char* WSAAPI gai_strerrorA(int);
> WCHAR* WSAAPI gai_strerrorW(int);
> #ifdef UNICODE
> #define gai_strerror   gai_strerrorW
> #else
> #define gai_strerror   gai_strerrorA
> #endif  /* UNICODE */
>
>
> As a result, shouldn't we always declare gai_strerror() in case the
> function is missing but the declaration is available?

I'm not sure how to handle this.  Declaring the function doesn't seem
like a solution, since it will still collide with their definition (we
use 'const' and they don't, and they add 'WSAAPI', but the last part
may not matter).

However, perhaps the error is that getaddrinfo/gai_strerror is built
at all on your system.  mingw32 appear to have working getaddrinfo, so
we shouldn't need to build anything.

/Simon




reply via email to

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