+2008-11-15 Bruno Haible <bruno@clisp.org>
+
+ * lib/netdb.in.h: Activate the definitions also when the system's
+ <netdb.h> has 'struct addrinfo'.
+ * m4/netdb_h.m4 (gl_HEADER_NETDB): Replace netdb.h also when it lacks
+ EAI_OVERFLOW or AI_NUMERICSERV.
+ * doc/posix-headers/netdb.texi: Document the problem.
+
2008-11-15 Bruno Haible <bruno@clisp.org>
* tests/test-sched.c: Test also the existence of the SCHED_* macros.
@item
This header file is incomplete on some platforms:
-Cygwin 1.5.x
+Cygwin 1.5.x, Haiku.
@end itemize
Portability problems not fixed by Gnulib:
#ifndef _GL_NETDB_H
#define _GL_NETDB_H
-#if @HAVE_NETDB_H@ && @HAVE_STRUCT_ADDRINFO@
-
-/* Declarations for a platform that has <netdb.h>. */
-
-#else
-
/* Get netdb.h definitions such as struct hostent for MinGW. */
#include <sys/socket.h>
# endif
# ifndef EAI_OVERFLOW
-/* Not defined on mingw32. */
+/* Not defined on mingw32 and Haiku. */
# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
# endif
# ifndef EAI_ADDRFAMILY
#endif /* @GNULIB_GETADDRINFO@ */
-#endif /* HAVE_NETDB_H */
-
#endif /* _GL_NETDB_H */
#endif /* _GL_NETDB_H */
-# netdb_h.m4 serial 4
+# netdb_h.m4 serial 5
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,
AC_REQUIRE([gl_NETDB_H_DEFAULTS])
gl_CHECK_NEXT_HEADERS([netdb.h])
if test $ac_cv_header_netdb_h = yes; then
- AC_CHECK_TYPES([struct addrinfo], [NETDB_H=''], [NETDB_H='netdb.h'],
- [[#include <netdb.h>]])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <netdb.h>
+ struct addrinfo a;
+ int b = EAI_OVERFLOW;
+ int c = AI_NUMERICSERV;
+ ]])],
+ [NETDB_H=''], [NETDB_H='netdb.h'])
HAVE_NETDB_H=1
else
NETDB_H='netdb.h'