-# 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,
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'
#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>. */
/* 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@
-# 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,
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'
#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>. */
/* 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@
/* Re-define FD_ISSET to avoid a WSA call while we are not using
network sockets. */
static inline int
-rpl_fd_isset (int fd, fd_set * set)
+rpl_fd_isset (SOCKET fd, fd_set * set)
{
- int i;
+ u_int i;
if (set == NULL)
return 0;