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?

-- 
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: m4/getaddrinfo.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/getaddrinfo.m4,v
retrieving revision 1.18
diff -u -p -r1.18 getaddrinfo.m4
--- m4/getaddrinfo.m4	9 Aug 2006 22:52:40 -0000	1.18
+++ m4/getaddrinfo.m4	17 Jan 2007 13:55:06 -0000
@@ -58,7 +58,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
   AC_REQUIRE([AC_C_INLINE])
   AC_REQUIRE([AC_GNU_SOURCE])
   AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h)
-  AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[
+  AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, getnameinfo],,,[
   /* sys/types.h is not needed according to POSIX, but the
      sys/socket.h in i386-unknown-freebsd4.10 and
      powerpc-apple-darwin5.5 required it. */
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	17 Jan 2007 13:55:06 -0000
@@ -126,12 +126,14 @@ extern int getaddrinfo (const char *rest
 extern void freeaddrinfo (struct addrinfo *ai);
 #endif
 
-#if !HAVE_DECL_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_gail_strerror
+
 extern const char *gai_strerror (int ecode);
-#endif
 
 #if !HAVE_DECL_GETNAMEINFO
 /* Convert socket address to printable node and service names.

Reply via email to