Eric Blake <ebb9 <at> byu.net> writes: > $ gnulib-tool --test getaddrinfo > ... > gcc -DHAVE_CONFIG_H -I. -I../../lib -I.. -Wall -O2 - > c ../../lib/getaddrinfo.c > ../../lib/getaddrinfo.c: In function `getnameinfo': > ../../lib/getaddrinfo.c:324: error: `NI_NUMERICHOST' undeclared (first use in > this function) > ../../lib/getaddrinfo.c:324: error: (Each undeclared identifier is reported > only once > ../../lib/getaddrinfo.c:324: error: for each function it appears in.) > ../../lib/getaddrinfo.c:326: error: `NI_NUMERICSERV' undeclared (first use in > this function) > ../../lib/getaddrinfo.c:356: warning: implicit declaration of function > `inet_ntop' > ../../lib/getaddrinfo.c:386: warning: implicit declaration of function > `snprintf' > make[3]: *** [getaddrinfo.o] Error 1 >
This should fix it: lib/ChangeLog: 2006-07-05 Eric Blake <[EMAIL PROTECTED]> * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if missing from netdb.h. * getaddrinfo.c (includes): Include inet_ntop and snprintf. ChangeLog: 2006-07-05 Eric Blake <[EMAIL PROTECTED]> * modules/getaddrinfo (Depends-on): Add snprintf. Index: lib/getaddrinfo.c =================================================================== RCS file: /sources/gnulib/gnulib/lib/getaddrinfo.c,v retrieving revision 1.11 diff -u -r1.11 getaddrinfo.c --- lib/getaddrinfo.c 1 Jul 2006 06:47:16 -0000 1.11 +++ lib/getaddrinfo.c 5 Jul 2006 14:25:47 -0000 @@ -38,6 +38,8 @@ #define _(String) gettext (String) #define N_(String) String +#include "inet_ntop.h" +#include "snprintf.h" #include "strdup.h" #if defined _WIN32 || defined __WIN32__ Index: lib/getaddrinfo.h =================================================================== RCS file: /sources/gnulib/gnulib/lib/getaddrinfo.h,v retrieving revision 1.14 diff -u -r1.14 getaddrinfo.h --- lib/getaddrinfo.h 29 Jun 2006 15:16:56 -0000 1.14 +++ lib/getaddrinfo.h 5 Jul 2006 14:25:47 -0000 @@ -142,4 +142,12 @@ # endif +/* Possible flags for getnameinfo. */ +# ifndef NI_NUMERICHOST +# define NI_NUMERICHOST 1 +# endif +# ifndef NI_NUMERICSERV +# define NI_NUMERICSERV 2 +# endif + #endif /* GETADDRINFO_H */ Index: modules/getaddrinfo =================================================================== RCS file: /sources/gnulib/gnulib/modules/getaddrinfo,v retrieving revision 1.7 diff -u -r1.7 getaddrinfo --- modules/getaddrinfo 28 Jun 2006 11:08:35 -0000 1.7 +++ modules/getaddrinfo 5 Jul 2006 14:25:47 -0000 @@ -11,6 +11,7 @@ Depends-on: restrict gettext-h +snprintf socklen stdbool strdup