netdb: also supply struct addrinfo for cygwin 1.5.x
authorEric Blake <ebb9@byu.net>
Wed, 22 Oct 2008 11:34:48 +0000 (05:34 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 22 Oct 2008 11:38:48 +0000 (05:38 -0600)
* 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>
ChangeLog
doc/posix-headers/netdb.texi
lib/netdb.in.h
m4/netdb_h.m4

index f1e189f..46ecb98 100644 (file)
--- 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.
index 1654013..caef8e2 100644 (file)
@@ -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:
index 0399646..9c66ae8 100644 (file)
@@ -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@
 
index ecb57b4..bbe166f 100644 (file)
@@ -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_DEFUN([gl_HEADER_NETDB],
   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'