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 4a76cc8..f66e1c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 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.
        * lib/arpa_inet.in.h: Include c++defs.h.
        (inet_ntop, inet_pton): Declare using the macros with C++ namespace
index 86fcc67..7ff4965 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 d70d34a..66b340e 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 cfbd977..d5cf265 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 80fdb40..44c5da3 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 a6d219c..c0f9aa1 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 193f17d..6e1da3b 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