* getaddrinfo.m4: Include sys/types.h for sys/socket.h, on FreeBSD
and Darwin.
2005-10-01 Simon Josefsson <jas@extundo.com>
+ * getaddrinfo.m4: Include sys/types.h for sys/socket.h, on FreeBSD
+ and Darwin.
+
* getaddrinfo.m4: Use AC_GNU_SOURCE, GNU only declare getaddrinfo
as an (POSIX) extension. Check for sys/types.h, sys/socket.h, and
netdb.h too, needed by getaddrinfo.h. Check if 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
#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