From 1f022b6b964c3d09f78f386790c5ba566befe411 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 1 Oct 2005 11:59:08 +0000 Subject: Include sys/types.h for sys/socket.h, on FreeBSD and Darwin. --- m4/getaddrinfo.m4 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'm4') diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4 index f95bb1a93..be44232d7 100644 --- a/m4/getaddrinfo.m4 +++ b/m4/getaddrinfo.m4 @@ -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 +#endif #ifdef HAVE_SYS_SOCKET_H # include #endif @@ -29,6 +35,9 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ #endif ]) AC_CHECK_TYPES([struct addrinfo],,,[ +#ifdef HAVE_SYS_TYPES_H +# include +#endif #ifdef HAVE_SYS_SOCKET_H # include #endif -- cgit v1.2.3-70-g09d2