diff --git a/ares/ares_process.c b/ares/ares_process.c index 0a133a27f..4ff918e22 100644 --- a/ares/ares_process.c +++ b/ares/ares_process.c @@ -21,14 +21,24 @@ #include "nameser.h" #else +#ifdef HAVE_SYS_SOCKET_H #include +#endif #ifdef HAVE_SYS_UIO_H #include #endif -#include /* for TCP_NODELAY */ -#include +#ifdef HAVE_NETINET_IN_H +#include /* may need it */ +#endif +#ifdef HAVE_NETINET_TCP_H +#include /* for TCP_NODELAY */ +#endif +#ifdef HAVE_NETDB_H #include +#endif +#ifdef HAVE_ARPA_NAMESER_H #include +#endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H #include #endif diff --git a/ares/configure.ac b/ares/configure.ac index 874901d9e..22fb4b35d 100644 --- a/ares/configure.ac +++ b/ares/configure.ac @@ -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 \