diff options
author | Jim Meyering <jim@meyering.net> | 2005-10-01 11:59:08 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-10-01 11:59:08 +0000 |
commit | 1f022b6b964c3d09f78f386790c5ba566befe411 (patch) | |
tree | 28413986d867a6696e7718160f9a87d8af65ae4b /m4 | |
parent | a2a3fc0ac71e7cd5965a1fa1afe29061de1b9107 (diff) | |
download | coreutils-1f022b6b964c3d09f78f386790c5ba566befe411.tar.xz |
Include sys/types.h for sys/socket.h, on FreeBSD and Darwin.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/getaddrinfo.m4 | 9 |
1 files changed, 9 insertions, 0 deletions
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 <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 |