AC_CACHE_CHECK([for struct addrinfo],samba_cv_HAVE_STRUCT_ADDRINFO,[
AC_TRY_COMPILE([
#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
#include <sys/socket.h>
#include <netdb.h>],
[
dnl test for getaddrinfo/getnameinfo
AC_CACHE_CHECK([for getaddrinfo],samba_cv_HAVE_GETADDRINFO,[
AC_TRY_COMPILE([
-#include <sys/socket.h>
#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <sys/socket.h>
#include <netdb.h>],
[
struct sockaddr sa;