Simon Josefsson wrote: > Btw, a solaris system I have access to declares the function as follows > (in system arpa/inet.h): > > #if !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) > extern int inet_pton(int, const char *_RESTRICT_KYWD, void *_RESTRICT_KYWD); > extern const char *inet_ntop(int, const void *_RESTRICT_KYWD, > char *_RESTRICT_KYWD, socklen_t); > #endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */ > > Would setting any of those defines, to get the system's prototypes, be > the right thing?
Yes, sure. Well spotted. The flag that you need is __EXTENSIONS__, and - surprise surprise - it is enabled by gnulib's 'extensions' module. This is what was missing: 2008-04-29 Bruno Haible <[EMAIL PROTECTED]> * m4/inet_ntop.m4 (gl_INET_NTOP): Require gl_USE_SYSTEM_EXTENSIONS. * m4/inet_pton.m4 (gl_INET_PTON): Likewise. * modules/inet_ntop (Depends-on): Add extensions. * modules/inet_pton (Depends-on): Likewise. Reported by Simon Josefsson. *** m4/inet_ntop.m4.orig 2008-04-30 01:27:13.000000000 +0200 --- m4/inet_ntop.m4 2008-04-30 01:19:40.000000000 +0200 *************** *** 6,11 **** --- 6,14 ---- AC_DEFUN([gl_INET_NTOP], [ + dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) ARPA_INET_H='arpa/inet.h' *** m4/inet_pton.m4.orig 2008-04-30 01:27:13.000000000 +0200 --- m4/inet_pton.m4 2008-04-30 01:19:40.000000000 +0200 *************** *** 6,11 **** --- 6,14 ---- AC_DEFUN([gl_INET_PTON], [ + dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) ARPA_INET_H='arpa/inet.h' *** modules/inet_ntop.orig 2008-04-30 01:27:13.000000000 +0200 --- modules/inet_ntop 2008-04-30 01:26:07.000000000 +0200 *************** *** 10,15 **** --- 10,16 ---- sys_socket arpa_inet netinet_in + extensions configure.ac: gl_INET_NTOP *** modules/inet_pton.orig 2008-04-30 01:27:13.000000000 +0200 --- modules/inet_pton 2008-04-30 01:26:12.000000000 +0200 *************** *** 10,15 **** --- 10,16 ---- sys_socket arpa_inet netinet_in + extensions configure.ac: gl_INET_PTON