check availability of <netinet/tcp.h>
authorYang Tse <yangsita@gmail.com>
Sun, 30 Sep 2007 02:12:11 +0000 (02:12 +0000)
committerYang Tse <yangsita@gmail.com>
Sun, 30 Sep 2007 02:12:11 +0000 (02:12 +0000)
ares/ares_process.c
ares/configure.ac

index 0a133a2..4ff918e 100644 (file)
 #include "nameser.h"
 
 #else
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
 #ifdef HAVE_SYS_UIO_H
 #include <sys/uio.h>
 #endif
-#include <netinet/tcp.h>   /* for TCP_NODELAY */
-#include <netinet/in.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h> /* <netinet/tcp.h> may need it */
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h> /* for TCP_NODELAY */
+#endif
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
 #include <arpa/nameser.h>
+#endif
 #ifdef HAVE_ARPA_NAMESER_COMPAT_H
 #include <arpa/nameser_compat.h>
 #endif
index 874901d..22fb4b3 100644 (file)
@@ -340,6 +340,7 @@ AC_CHECK_HEADERS(
        sys/param.h \
        netdb.h \
        netinet/in.h \
+       netinet/tcp.h \
        net/if.h \
        errno.h \
        stdbool.h \