Include sys/types.h for sys/socket.h, on FreeBSD and Darwin.

This commit is contained in:
Jim Meyering 2005-10-01 11:59:08 +00:00
parent a2a3fc0ac7
commit 1f022b6b96

View File

@ -21,6 +21,12 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
AC_REQUIRE([AC_GNU_SOURCE])
AC_CHECK_HEADERS_ONCE(sys/socket.h netdb.h sys/types.h netinet/in.h)
AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror],,,[
/* sys/types.h is not needed according to POSIX, but the
sys/socket.h in i386-unknown-freebsd4.10 and
powerpc-apple-darwin5.5 required it. */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
@ -29,6 +35,9 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
#endif
])
AC_CHECK_TYPES([struct addrinfo],,,[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif