inet_ntop, inet_pton: Ensure declaration on NonStop Kernel.
authorBruno Haible <bruno@clisp.org>
Mon, 27 Dec 2010 00:22:00 +0000 (01:22 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 27 Dec 2010 00:30:41 +0000 (01:30 +0100)
* lib/arpa_inet.in.h: On NonStop Kernel, include also <netdb.h>.
* m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Likewise.
* m4/inet_ntop.m4 (gl_PREREQ_INET_NTOP): Include also <netdb.h> 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
doc/posix-functions/inet_ntop.texi
doc/posix-functions/inet_pton.texi
lib/arpa_inet.in.h
m4/arpa_inet_h.m4
m4/inet_ntop.m4
m4/inet_pton.m4

index 4a76cc8f661de5cc4601f95200000e4f6678ccc7..f66e1c4bc6485ea1d81a1c618ce61bd717860678 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-26  Bruno Haible  <bruno@clisp.org>
+
+       inet_ntop, inet_pton: Ensure declaration on NonStop Kernel.
+       * lib/arpa_inet.in.h: On NonStop Kernel, include also <netdb.h>.
+       * m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Likewise.
+       * m4/inet_ntop.m4 (gl_PREREQ_INET_NTOP): Include also <netdb.h> 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  <bruno@clisp.org>
 
        arpa_inet: Use the common idioms with C++ support.
index 86fcc672be5e6b2af44c41ae5ea5145479c270e9..7ff49656420c97b162f8b82d93b0bede86374e4a 100644 (file)
@@ -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{<netdb.h>} instead of @code{<arpa/inet.h>}
+on some platforms:
+NonStop Kernel.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index d70d34af340b89473fe5a2e60c1c38424b4e9dba..66b340eec849e5a3d54ec5faa40d9dadb1cdb0c9 100644 (file)
@@ -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{<netdb.h>} instead of @code{<arpa/inet.h>}
+on some platforms:
+NonStop Kernel.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index cfbd97791742f7a97711b7dcfbb7ac04b20427dd..d5cf2657128ed82b64eafef083481e73b926c11a 100644 (file)
 # include <sys/socket.h>
 #endif
 
+/* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>.
+   But avoid namespace pollution on glibc systems.  */
+#if defined __TANDEM && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
 #if @HAVE_ARPA_INET_H@
 
 /* The include_next requires a split double-inclusion guard.  */
index 80fdb406b637ab22e3e3eeac87351e85dc704006..44c5da32930f4111389ae29de1c2858c1274c860 100644 (file)
@@ -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 <sys/socket.h>
 #endif
+#ifdef __TANDEM
+# include <netdb.h>
+#endif
 #include <arpa/inet.h>
     ]], [inet_ntop inet_pton])
 ])
index a6d219c208e7b74b3acad9d7f3156c93ba3f7693..c0f9aa1a95a44917660830a5c01bc4eca3a57494 100644 (file)
@@ -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 <arpa/inet.h>])
+  AC_CHECK_HEADERS_ONCE([netdb.h])
+  AC_CHECK_DECLS([inet_ntop],,,
+    [#include <arpa/inet.h>
+     #if HAVE_NETDB_H
+     # include <netdb.h>
+     #endif
+    ])
   if test $ac_cv_have_decl_inet_ntop = no; then
     HAVE_DECL_INET_NTOP=0
   fi
index 193f17d0a34eea10cc5db76d3e5dfcf61b1a33cd..6e1da3ba9c7d77723aeb27b083c408bc56c5b560 100644 (file)
@@ -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 <arpa/inet.h>])
+  AC_CHECK_HEADERS_ONCE([netdb.h])
+  AC_CHECK_DECLS([inet_pton],,,
+    [#include <arpa/inet.h>
+     #if HAVE_NETDB_H
+     # include <netdb.h>
+     #endif
+    ])
   if test $ac_cv_have_decl_inet_pton = no; then
     HAVE_DECL_INET_PTON=0
   fi