changeset 10698:bd389c336def

netdb: also supply struct addrinfo for cygwin 1.5.x * m4/netdb_h.m4 (gl_HEADER_NETDB): Check for incomplete header on older cygwin. * lib/netdb.in.h [!HAVE_STRUCT_ADDRINFO]: Also supply contents for cygwin. * doc/posix-headers/netdb.texi (netdb.h): Document this. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Wed, 22 Oct 2008 05:34:48 -0600
parents 9258197a00e4
children a8d2d376c1df
files ChangeLog doc/posix-headers/netdb.texi lib/netdb.in.h m4/netdb_h.m4
diffstat 4 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-10-22  Eric Blake  <ebb9@byu.net>
+
+	netdb: also supply struct addrinfo for cygwin 1.5.x
+	* m4/netdb_h.m4 (gl_HEADER_NETDB): Check for incomplete header on
+	older cygwin.
+	* lib/netdb.in.h [!HAVE_STRUCT_ADDRINFO]: Also supply contents for
+	cygwin.
+	* doc/posix-headers/netdb.texi (netdb.h): Document this.
+
 2008-10-22  Bruno Haible  <bruno@clisp.org>
 
 	* users.txt: Update entry about pspp.
--- a/doc/posix-headers/netdb.texi
+++ b/doc/posix-headers/netdb.texi
@@ -3,13 +3,17 @@
 
 POSIX specification: @url{http://www.opengroup.org/susv3xbd/netdb.h.html}
 
-Gnulib module: ---
+Gnulib module: netdb
 
 Portability problems fixed by Gnulib:
 @itemize
 @item
 This header file is missing on some platforms:
 mingw, BeOS.
+
+@item
+This header file is incomplete on some platforms:
+Cygwin 1.5.x
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- a/lib/netdb.in.h
+++ b/lib/netdb.in.h
@@ -36,7 +36,7 @@
 #ifndef _GL_NETDB_H
 #define _GL_NETDB_H
 
-#if @HAVE_NETDB_H@
+#if @HAVE_NETDB_H@ && HAVE_STRUCT_ADDRINFO
 
 /* Declarations for a platform that has <netdb.h>.  */
 
@@ -45,7 +45,8 @@
 /* Get netdb.h definitions such as struct hostent for MinGW.  */
 #include <sys/socket.h>
 
-/* Declarations for a platform that lacks <netdb.h>.  */
+/* Declarations for a platform that lacks <netdb.h>, or where it is
+   incomplete.  */
 
 #if @GNULIB_GETADDRINFO@
 
--- a/m4/netdb_h.m4
+++ b/m4/netdb_h.m4
@@ -1,4 +1,4 @@
-# netdb_h.m4 serial 2
+# netdb_h.m4 serial 3
 dnl Copyright (C) 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,8 @@
   AC_REQUIRE([gl_NETDB_H_DEFAULTS])
   gl_CHECK_NEXT_HEADERS([netdb.h])
   if test $ac_cv_header_netdb_h = yes; then
-    NETDB_H=''
+    AC_CHECK_TYPES([struct addrinfo], [NETDB_H=''], [NETDB_H='netdb.h'],
+                   [[#include <netdb.h>]])
     HAVE_NETDB_H=1
   else
     NETDB_H='netdb.h'