From 9a53061cb862d6ac80fd752f9032b02d4e759e55 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 22 Oct 2008 05:34:48 -0600 Subject: [PATCH] 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 --- ChangeLog | 9 +++++++++ doc/posix-headers/netdb.texi | 6 +++++- lib/netdb.in.h | 5 +++-- m4/netdb_h.m4 | 5 +++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1e189fcb..46ecb9893 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-10-22 Eric Blake + + 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 * users.txt: Update entry about pspp. diff --git a/doc/posix-headers/netdb.texi b/doc/posix-headers/netdb.texi index 165401388..caef8e247 100644 --- 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: diff --git a/lib/netdb.in.h b/lib/netdb.in.h index 03996464a..9c66ae815 100644 --- 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 . */ @@ -45,7 +45,8 @@ /* Get netdb.h definitions such as struct hostent for MinGW. */ #include -/* Declarations for a platform that lacks . */ +/* Declarations for a platform that lacks , or where it is + incomplete. */ #if @GNULIB_GETADDRINFO@ diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4 index ecb57b4e6..bbe166fab 100644 --- 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_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 ]]) HAVE_NETDB_H=1 else NETDB_H='netdb.h' -- 2.11.0