Re: [PATCH] getaddrinfo: fix gai_strerror signature

2011-04-29 Thread Eric Blake
On 04/29/2011 06:09 AM, Bruno Haible wrote: > Eric Blake wrote: >> +getaddrinfo: fix gai_strerror signature >> +* m4/getaddrinfo.m4 (gl_GETADDRINFO): Detect broken signatures, >> +and work around mingw with UNICODE defined. >> +(gl_PREREQ_GETADDRINFO)

Re: replace gai_strerror on mingw?

2011-04-29 Thread Eric Blake
ction? 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 header has an inline definition of gai_strerrorA and gai_strerr

Re: [PATCH] getaddrinfo: fix gai_strerror signature

2011-04-29 Thread Bruno Haible
Eric Blake wrote: > + getaddrinfo: fix gai_strerror signature > + * m4/getaddrinfo.m4 (gl_GETADDRINFO): Detect broken signatures, > + and work around mingw with UNICODE defined. > + (gl_PREREQ_GETADDRINFO): Drop redundant decl check. > + * m4/netdb_h.m4 (gl_N

Re: [PATCH] getaddrinfo: fix gai_strerror signature

2011-04-29 Thread Paolo Bonzini
On 04/29/2011 01:34 AM, Eric Blake wrote: Worse, on mingw, if UNICODE is defined, it is defined to return WCHAR*, which means the result is in unicode but an application expecting bytes for characters will only see a one-byte answer. AFAIR, Bruno didn't like introducing special hacks for the mi

Re: [PATCH] getaddrinfo: fix gai_strerror signature

2011-04-29 Thread Simon Josefsson
Eric Blake writes: > Several platforms declare gai_strerror to return char* rather than > const char*. Worse, on mingw, if UNICODE is defined, it is defined > to return WCHAR*, which means the result is in unicode but an > application expecting bytes for characters will only se

Re: replace gai_strerror on mingw?

2011-04-29 Thread Simon Josefsson
Eric Blake writes: > On mingw, gai_strerror has two different return types, depending on > whether UNICODE was defined at the time the header was included. Both > types (char* and WCHAR*) are incompatible with the POSIX return type of > const char*. Furthermore, a WCHAR* return

[PATCH] getaddrinfo: fix gai_strerror signature

2011-04-28 Thread Eric Blake
Several platforms declare gai_strerror to return char* rather than const char*. Worse, on mingw, if UNICODE is defined, it is defined to return WCHAR*, which means the result is in unicode but an application expecting bytes for characters will only see a one-byte answer. * m4/getaddrinfo.m4

replace gai_strerror on mingw?

2011-04-28 Thread Eric Blake
On mingw, gai_strerror has two different return types, depending on whether UNICODE was defined at the time the header was included. Both types (char* and WCHAR*) are incompatible with the POSIX return type of const char*. Furthermore, a WCHAR* return renders the return string worthless for an

Re: gai_strerror on mingw32

2007-06-28 Thread Simon Josefsson
> Bruno Haible <[EMAIL PROTECTED]> > > * m4/getaddrinfo.m4 (gl_GETADDRINFO): Require gl_HEADER_SYS_SOCKET > before using HAVE_WS2TCPIP_H. Check for gai_strerror through an > explicit link test, rather than AC_REPLACE_FUNCS - for mingw. >

Re: gai_strerror on mingw32

2007-06-27 Thread Bruno Haible
or catching this!! How about this one? 2007-06-27 Simon Josefsson <[EMAIL PROTECTED]> Bruno Haible <[EMAIL PROTECTED]> * m4/getaddrinfo.m4 (gl_GETADDRINFO): Require gl_HEADER_SYS_SOCKET before using HAVE_WS2TCPIP_H. Check for gai_strerror through an

Re: gai_strerror on mingw32

2007-06-27 Thread Eric Blake
Bruno Haible clisp.org> writes: > How about this? > > 2007-06-27 Simon Josefsson josefsson.org> > Bruno Haible clisp.org> > > * m4/getaddrinfo.m4 (gl_GETADDRINFO): Check for ws2tcpip.h before > using HAVE_WS2TCPIP_H. Check for ga

Re: gai_strerror on mingw32

2007-06-27 Thread Bruno Haible
Hi Simon, > - AC_REPLACE_FUNCS(gai_strerror) > + # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an > + # inline function declared in ws2tcpip.h, so we need to get that > + # header included somehow. > + AC_MSG_CHECKING([for gai_strerror (pos

gai_strerror on mingw32

2007-06-27 Thread Simon Josefsson
Hi! Mingw32 contains in ws2tcpip.h: static __inline char* gai_strerrorA(int ecode) ... #define gai_strerror gai_strerrorA Thus, the following test in getaddrinfo.m4 will incorrectly return 'no': AC_REPLACE_FUNCS(gai_strerror) since the function isn't in any library. How abou

gai_strerror

2007-01-31 Thread Jean-Louis Martineau
Hello, There is no message for the EAI_OVERFLOW error in gai_strerror. The getnameinfo can return the EAI_OVERFLOW error. Patch attached. Jean-Louis Index: lib/gai_strerror.c === --- lib/gai_strerror.c (revision 5025) +++ lib

Re: gai_strerror and EAI_OVERFLOW

2007-01-31 Thread Simon Josefsson
Jean-Louis Martineau <[EMAIL PROTECTED]> writes: > The gai_strerror function doesn't return an error message for the > EAI_OVERFLOW error code. > > getnameinfo can return the EAI_OVERFLOW error. Thanks, installed. /Simon

gai_strerror and EAI_OVERFLOW

2007-01-31 Thread Jean-Louis Martineau
The gai_strerror function doesn't return an error message for the EAI_OVERFLOW error code. getnameinfo can return the EAI_OVERFLOW error. Patch attached. Jean-Louis Index: lib/gai_strerror.c === --- lib/gai_strerror.c (rev

Re: MinGW gai_strerror conflict

2007-01-19 Thread Yoann Vandoorselaere
> > >> use 'const' and they don't, and they add 'WSAAPI', but the last part > > >> may not matter). > > > > > > We could use a replacement function: > > > > > > #undef gai_strerror > > > #define gai_strerror rp

Re: MinGW gai_strerror conflict

2007-01-17 Thread Yoann Vandoorselaere
; >> 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 > >&g

Re: MinGW gai_strerror conflict

2007-01-17 Thread Simon Josefsson
o() 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 >> > [...] >> &g

Re: MinGW gai_strerror conflict

2007-01-17 Thread Simon Josefsson
s2_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-al

Re: MinGW gai_strerror conflict

2007-01-17 Thread Yoann Vandoorselaere
ddrinfo... 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

MinGW gai_strerror conflict

2007-01-17 Thread Yoann Vandoorselaere
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