diff --git a/adig.c b/adig.c index 031ce815..66b64a4a 100644 --- a/adig.c +++ b/adig.c @@ -17,26 +17,35 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#ifdef HAVE_NETDB_H +# include +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include #else -#ifdef HAVE_SYS_TIME_H -#include +# include "nameser.h" #endif -#include -#include -#include -#include #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include +# include #endif -#ifdef HAVE_UNISTD_H -#include + +#ifdef HAVE_SYS_TIME_H +# include #endif -#include +#ifdef HAVE_UNISTD_H +# include #endif #ifdef HAVE_STRINGS_H -#include +# include #endif #include diff --git a/ares_expand_name.c b/ares_expand_name.c index 9c05546d..dc5b1075 100644 --- a/ares_expand_name.c +++ b/ares_expand_name.c @@ -17,18 +17,16 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif #include diff --git a/ares_expand_string.c b/ares_expand_string.c index 5a3ae182..ead60a40 100644 --- a/ares_expand_string.c +++ b/ares_expand_string.c @@ -17,15 +17,13 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include -#endif +# include +#else +# include "nameser.h" #endif #include diff --git a/ares_gethostbyaddr.c b/ares_gethostbyaddr.c index 1274d5ac..85e2e39f 100644 --- a/ares_gethostbyaddr.c +++ b/ares_gethostbyaddr.c @@ -16,27 +16,25 @@ */ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_NETDB_H -#include +# include #endif #ifdef HAVE_ARPA_INET_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif #include diff --git a/ares_gethostbyname.c b/ares_gethostbyname.c index 3048bb25..a32da8f6 100644 --- a/ares_gethostbyname.c +++ b/ares_gethostbyname.c @@ -17,30 +17,25 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_NETDB_H -#include +# include #endif #ifdef HAVE_ARPA_INET_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif #include diff --git a/ares_getnameinfo.c b/ares_getnameinfo.c index 8a6d4811..99d3b87d 100644 --- a/ares_getnameinfo.c +++ b/ares_getnameinfo.c @@ -16,27 +16,25 @@ */ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_NETDB_H -#include +# include #endif #ifdef HAVE_ARPA_INET_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif #ifdef HAVE_NET_IF_H diff --git a/ares_init.c b/ares_init.c index d4e15052..4d4ba1ea 100644 --- a/ares_init.c +++ b/ares_init.c @@ -19,11 +19,10 @@ #include "setup.h" #if defined(WIN32) && !defined(WATT32) -#include "nameser.h" #include #include +#endif -#else #ifdef HAVE_SYS_PARAM_H #include #endif @@ -49,16 +48,17 @@ #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif - #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include +# include #endif + #ifdef HAVE_UNISTD_H #include #endif -#endif #include #include diff --git a/ares_mkquery.c b/ares_mkquery.c index 739e235b..a9c9187f 100644 --- a/ares_mkquery.c +++ b/ares_mkquery.c @@ -17,18 +17,16 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif #include diff --git a/ares_parse_a_reply.c b/ares_parse_a_reply.c index 85af9964..6380f5ba 100644 --- a/ares_parse_a_reply.c +++ b/ares_parse_a_reply.c @@ -17,30 +17,29 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_NETDB_H -#include +# include #endif #ifdef HAVE_ARPA_INET_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif + #ifdef HAVE_STRINGS_H -#include +# include #endif #include diff --git a/ares_parse_aaaa_reply.c b/ares_parse_aaaa_reply.c index 812694eb..6a43f933 100644 --- a/ares_parse_aaaa_reply.c +++ b/ares_parse_aaaa_reply.c @@ -17,30 +17,29 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_NETDB_H -#include +# include #endif #ifdef HAVE_ARPA_INET_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif + #ifdef HAVE_STRINGS_H -#include +# include #endif #include diff --git a/ares_parse_ns_reply.c b/ares_parse_ns_reply.c index e3a89abb..9eed3ebe 100644 --- a/ares_parse_ns_reply.c +++ b/ares_parse_ns_reply.c @@ -20,27 +20,25 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_NETDB_H -#include +# include #endif #ifdef HAVE_ARPA_INET_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif #include diff --git a/ares_parse_ptr_reply.c b/ares_parse_ptr_reply.c index 4905e845..13ff6521 100644 --- a/ares_parse_ptr_reply.c +++ b/ares_parse_ptr_reply.c @@ -17,27 +17,26 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_NETDB_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif + #ifdef HAVE_STRINGS_H -#include +# include #endif #include diff --git a/ares_process.c b/ares_process.c index 824640ea..798df7a2 100644 --- a/ares_process.c +++ b/ares_process.c @@ -18,47 +18,45 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" - -#else #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_SYS_UIO_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include /* may need it */ +# include #endif #ifdef HAVE_NETINET_TCP_H -#include /* for TCP_NODELAY */ +# include #endif #ifdef HAVE_NETDB_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include +# include #endif + #ifdef HAVE_SYS_TIME_H -#include +# include #endif -#endif /* WIN32 && !WATT32 */ #ifdef HAVE_STRINGS_H -#include +# include #endif #ifdef HAVE_UNISTD_H -#include +# include #endif #ifdef HAVE_SYS_IOCTL_H -#include +# include #endif #ifdef NETWARE -#include +# include #endif #include diff --git a/ares_query.c b/ares_query.c index cc3b63af..25824593 100644 --- a/ares_query.c +++ b/ares_query.c @@ -17,18 +17,16 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif #include diff --git a/ares_search.c b/ares_search.c index c65f70f0..3ba26fe1 100644 --- a/ares_search.c +++ b/ares_search.c @@ -16,16 +16,13 @@ */ #include "setup.h" + #include #include #include #include #include -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#endif - #include "ares.h" #include "ares_private.h" diff --git a/ares_send.c b/ares_send.c index 6dc7b762..a5811d36 100644 --- a/ares_send.c +++ b/ares_send.c @@ -17,18 +17,16 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_ARPA_NAMESER_H -#include +# include +#else +# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H -#include -#endif +# include #endif #include diff --git a/inet_net_pton.c b/inet_net_pton.c index 487cd825..0936aa14 100644 --- a/inet_net_pton.c +++ b/inet_net_pton.c @@ -19,23 +19,22 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else - #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include +# include #endif #ifdef HAVE_ARPA_INET_H -#include +# include #endif - +#ifdef HAVE_ARPA_NAMESER_H +# include +#else +# include "nameser.h" +#endif +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +# include #endif #include diff --git a/inet_ntop.c b/inet_ntop.c index d07e19e3..914576f5 100644 --- a/inet_ntop.c +++ b/inet_ntop.c @@ -18,21 +18,22 @@ #include "setup.h" -#if defined(WIN32) && !defined(WATT32) -#include "nameser.h" -#else #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include +# include #endif #ifdef HAVE_ARPA_INET_H -#include +# include +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include +#else +# include "nameser.h" #endif +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +# include #endif #include diff --git a/nameser.h b/nameser.h index 52c29723..3d800964 100644 --- a/nameser.h +++ b/nameser.h @@ -5,7 +5,7 @@ /* header file provided by liren@vivisimo.com */ - +#ifndef HAVE_ARPA_NAMESER_H #define NS_PACKETSZ 512 /* maximum packet size */ #define NS_MAXDNAME 256 /* maximum domain name */ @@ -117,9 +117,9 @@ typedef enum __ns_rcode { ns_r_badtime = 18 } ns_rcode; +#endif /* HAVE_ARPA_NAMESER_H */ - - +#ifndef HAVE_ARPA_NAMESER_COMPAT_H #define PACKETSZ NS_PACKETSZ #define MAXDNAME NS_MAXDNAME @@ -189,6 +189,6 @@ typedef enum __ns_rcode { #define T_MAILA ns_t_maila #define T_ANY ns_t_any - +#endif /* HAVE_ARPA_NAMESER_COMPAT_H */ #endif /* ARES_NAMESER_H */ diff --git a/windows_port.c b/windows_port.c index cc31036a..fd13b148 100644 --- a/windows_port.c +++ b/windows_port.c @@ -5,20 +5,6 @@ /* only do the following on windows */ #if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS) -#include -#include -#include -#include -#include -#include - -#ifdef WATT32 -#include -#else -#include "nameser.h" -#endif -#include "ares.h" -#include "ares_private.h" #ifdef __WATCOMC__ /* @@ -34,5 +20,4 @@ WINAPI DllMain (HINSTANCE hnd, DWORD reason, LPVOID reserved) } #endif - #endif /* WIN32 builds only */