From 0e6072c19800f82647e65c1bd663766ffd497200 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 27 Dec 2010 01:22:00 +0100 Subject: [PATCH] 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. --- ChangeLog | 12 ++++++++++++ doc/posix-functions/inet_ntop.texi | 4 ++++ doc/posix-functions/inet_pton.texi | 4 ++++ lib/arpa_inet.in.h | 6 ++++++ m4/arpa_inet_h.m4 | 5 ++++- m4/inet_ntop.m4 | 10 ++++++++-- m4/inet_pton.m4 | 10 ++++++++-- 7 files changed, 46 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a76cc8f6..f66e1c4bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 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. * lib/arpa_inet.in.h: Include c++defs.h. (inet_ntop, inet_pton): Declare using the macros with C++ namespace diff --git a/doc/posix-functions/inet_ntop.texi b/doc/posix-functions/inet_ntop.texi index 86fcc672b..7ff496564 100644 --- a/doc/posix-functions/inet_ntop.texi +++ b/doc/posix-functions/inet_ntop.texi @@ -11,6 +11,10 @@ Portability problems fixed by Gnulib: @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 index d70d34af3..66b340eec 100644 --- a/doc/posix-functions/inet_pton.texi +++ b/doc/posix-functions/inet_pton.texi @@ -11,6 +11,10 @@ Portability problems fixed by Gnulib: @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 index cfbd97791..d5cf26571 100644 --- 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 index 80fdb406b..44c5da329 100644 --- 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 @@ AC_DEFUN([gl_HEADER_ARPA_INET], #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 index a6d219c20..c0f9aa1a9 100644 --- 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 @@ AC_DEFUN([gl_FUNC_INET_NTOP], # 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 index 193f17d0a..6e1da3ba9 100644 --- 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 @@ AC_DEFUN([gl_FUNC_INET_PTON], # 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 -- 2.11.0