Le mercredi 17 janvier 2007 à 14:56 +0100, Yoann Vandoorselaere a écrit : > Le mercredi 17 janvier 2007 à 14:50 +0100, Simon Josefsson a écrit : > > Yoann Vandoorselaere <[EMAIL PROTECTED]> writes: > > > > > Le mercredi 17 janvier 2007 à 13:57 +0100, Simon Josefsson a écrit : > > >> Yoann Vandoorselaere <[EMAIL PROTECTED]> writes: > > [...] > > > >> 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). > > > > > > We could use a replacement function: > > > > > > #undef gai_strerror > > > #define gai_strerror rpl_gai_strerror > > > > > > Shouldn't we? > > > > Hm, yes, that might work. > > > > >> 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. > > > > > > getaddrinfo() seem to be working (and the module handle that part fine), > > > but there is no gai_strerror() symbol available, which is a requirement > > > in an environment using getaddrinfo(), thus we should compile the > > > replacement function. > > > > Ah, I remember, it happened for Windows 2000 if I remember correctly. > > > > I don't have time to work on a solution here, but if you come up with > > anything, we can commit it and let the build bot test it. :) > > Would the attached patch be acceptable?
The previous patch was broken, here is an updated, tested version. -- Yoann Vandoorselaere | Responsable R&D / CTO | PreludeIDS Technologies Tel: +33 (0)8 70 70 21 58 Fax: +33(0)4 78 42 21 58 http://www.prelude-ids.com
Index: lib/getaddrinfo.h =================================================================== RCS file: /cvsroot/gnulib/gnulib/lib/getaddrinfo.h,v retrieving revision 1.18 diff -u -p -r1.18 getaddrinfo.h --- lib/getaddrinfo.h 22 Jul 2006 10:13:57 -0000 1.18 +++ lib/getaddrinfo.h 19 Jan 2007 12:43:53 -0000 @@ -126,11 +126,16 @@ extern int getaddrinfo (const char *rest extern void freeaddrinfo (struct addrinfo *ai); #endif -#if !HAVE_DECL_GAI_STRERROR + +#if !HAVE_DECL_GAI_STRERROR || !HAVE_GAI_STRERROR /* Convert error return from getaddrinfo() to a string. For more details, see the POSIX:2001 specification <http://www.opengroup.org/susv3xsh/gai_strerror.html>. */ +#undef gai_strerror +#define gai_strerror rpl_gai_strerror + extern const char *gai_strerror (int ecode); + #endif #if !HAVE_DECL_GETNAMEINFO