# HG changeset patch # User Bruno Haible # Date 1293409320 -3600 # Node ID 3f2c77c8adb885c399ee9158ed98075607b162d9 # Parent c475f1b6d204b132a64fe4d0ab2a2d194f711157 inet_ntop, inet_pton: Ensure declaration on NonStop Kernel. * lib/arpa_inet.in.h: On NonStop Kernel, include also . * m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Likewise. * m4/inet_ntop.m4 (gl_PREREQ_INET_NTOP): Include also when looking for the declaration. * m4/inet_pton.m4 (gl_PREREQ_INET_PTON): Likewise. * doc/posix-functions/inet_ntop.texi: Document the NonStop Kernel problem. * doc/posix-functions/inet_pton.texi: Likewise. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-12-26 Bruno Haible + + inet_ntop, inet_pton: Ensure declaration on NonStop Kernel. + * lib/arpa_inet.in.h: On NonStop Kernel, include also . + * m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Likewise. + * m4/inet_ntop.m4 (gl_PREREQ_INET_NTOP): Include also when + looking for the declaration. + * m4/inet_pton.m4 (gl_PREREQ_INET_PTON): Likewise. + * doc/posix-functions/inet_ntop.texi: Document the NonStop Kernel + problem. + * doc/posix-functions/inet_pton.texi: Likewise. + 2010-12-26 Bruno Haible arpa_inet: Use the common idioms with C++ support. diff --git a/doc/posix-functions/inet_ntop.texi b/doc/posix-functions/inet_ntop.texi --- a/doc/posix-functions/inet_ntop.texi +++ b/doc/posix-functions/inet_ntop.texi @@ -11,6 +11,10 @@ @item This function is missing on some platforms: HP-UX 11.00, OSF/1 4.0, Solaris 2.5.1, mingw, Interix 3.5, BeOS. +@item +This function is declared in @code{} instead of @code{} +on some platforms: +NonStop Kernel. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/inet_pton.texi b/doc/posix-functions/inet_pton.texi --- a/doc/posix-functions/inet_pton.texi +++ b/doc/posix-functions/inet_pton.texi @@ -11,6 +11,10 @@ @item This function is missing on some platforms: HP-UX 11.00, OSF/1 4.0, Solaris 2.5.1, mingw, Interix 3.5, BeOS. +@item +This function is declared in @code{} instead of @code{} +on some platforms: +NonStop Kernel. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h --- a/lib/arpa_inet.in.h +++ b/lib/arpa_inet.in.h @@ -34,6 +34,12 @@ # include #endif +/* On NonStop Kernel, inet_ntop and inet_pton are declared in . + But avoid namespace pollution on glibc systems. */ +#if defined __TANDEM && !defined __GLIBC__ +# include +#endif + #if @HAVE_ARPA_INET_H@ /* The include_next requires a split double-inclusion guard. */ diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4 --- a/m4/arpa_inet_h.m4 +++ b/m4/arpa_inet_h.m4 @@ -1,4 +1,4 @@ -# arpa_inet_h.m4 serial 10 +# arpa_inet_h.m4 serial 11 dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -31,6 +31,9 @@ #if !(defined __GLIBC__ || defined __UCLIBC__) # include #endif +#ifdef __TANDEM +# include +#endif #include ]], [inet_ntop inet_pton]) ]) diff --git a/m4/inet_ntop.m4 b/m4/inet_ntop.m4 --- a/m4/inet_ntop.m4 +++ b/m4/inet_ntop.m4 @@ -1,4 +1,4 @@ -# inet_ntop.m4 serial 12 +# inet_ntop.m4 serial 13 dnl Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -29,7 +29,13 @@ # Prerequisites of lib/inet_ntop.c. AC_DEFUN([gl_PREREQ_INET_NTOP], [ - AC_CHECK_DECLS([inet_ntop],,,[#include ]) + AC_CHECK_HEADERS_ONCE([netdb.h]) + AC_CHECK_DECLS([inet_ntop],,, + [#include + #if HAVE_NETDB_H + # include + #endif + ]) if test $ac_cv_have_decl_inet_ntop = no; then HAVE_DECL_INET_NTOP=0 fi diff --git a/m4/inet_pton.m4 b/m4/inet_pton.m4 --- a/m4/inet_pton.m4 +++ b/m4/inet_pton.m4 @@ -1,4 +1,4 @@ -# inet_pton.m4 serial 10 +# inet_pton.m4 serial 11 dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -29,7 +29,13 @@ # Prerequisites of lib/inet_pton.c. AC_DEFUN([gl_PREREQ_INET_PTON], [ - AC_CHECK_DECLS([inet_pton],,,[#include ]) + AC_CHECK_HEADERS_ONCE([netdb.h]) + AC_CHECK_DECLS([inet_pton],,, + [#include + #if HAVE_NETDB_H + # include + #endif + ]) if test $ac_cv_have_decl_inet_pton = no; then HAVE_DECL_INET_PTON=0 fi