summaryrefslogtreecommitdiff
path: root/ares_gethostbyname.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-09-15 17:14:29 (GMT)
committerYang Tse <yangsita@gmail.com>2008-09-15 17:14:29 (GMT)
commitf2582d69495d9b418d096d14f9db205b004a49c3 (patch)
tree31abd504060626baa78a77bc72c01d5bb778bca0 /ares_gethostbyname.c
parent746f3e2942c36511fda867cac0573d2907290db0 (diff)
downloadc-ares-f2582d69495d9b418d096d14f9db205b004a49c3.zip
c-ares-f2582d69495d9b418d096d14f9db205b004a49c3.tar.gz
c-ares-f2582d69495d9b418d096d14f9db205b004a49c3.tar.bz2
include header file only when available
Diffstat (limited to 'ares_gethostbyname.c')
-rw-r--r--ares_gethostbyname.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/ares_gethostbyname.c b/ares_gethostbyname.c
index be1f92b..3048bb2 100644
--- a/ares_gethostbyname.c
+++ b/ares_gethostbyname.c
@@ -20,10 +20,21 @@
#if defined(WIN32) && !defined(WATT32)
#include "nameser.h"
#else
+#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
-#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#include <arpa/nameser.h>
+#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif