From 0c677f578e8be6050c976f3923b833fbe8fc9cfb Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 14 Dec 2012 18:36:59 +0100 Subject: setup_once.h: refactor inclusion of and Inclusion of these two header files now done in setup_once.h --- acountry.c | 4 ---- adig.c | 6 ------ ahost.c | 5 +---- ares__close_sockets.c | 4 ---- ares__get_hostent.c | 3 --- ares_create_query.c | 3 --- ares_expand_name.c | 3 --- ares_expand_string.c | 3 --- ares_gethostbyaddr.c | 3 --- ares_gethostbyname.c | 3 --- ares_getnameinfo.c | 7 ------- ares_init.c | 8 -------- ares_nowarn.c | 3 --- ares_parse_a_reply.c | 3 --- ares_parse_aaaa_reply.c | 3 --- ares_parse_mx_reply.c | 3 --- ares_parse_naptr_reply.c | 3 --- ares_parse_ns_reply.c | 3 --- ares_parse_ptr_reply.c | 3 --- ares_parse_soa_reply.c | 3 --- ares_parse_srv_reply.c | 3 --- ares_parse_txt_reply.c | 3 --- ares_process.c | 6 ------ ares_query.c | 3 --- ares_send.c | 3 --- inet_net_pton.c | 3 --- inet_ntop.c | 3 --- setup_once.h | 8 ++++++++ 28 files changed, 9 insertions(+), 99 deletions(-) diff --git a/acountry.c b/acountry.c index 6a20374..7a855c0 100644 --- a/acountry.c +++ b/acountry.c @@ -34,9 +34,6 @@ #include "ares_setup.h" -#ifdef HAVE_UNISTD_H -#include -#endif #ifdef HAVE_STRINGS_H #include #endif @@ -44,7 +41,6 @@ #if defined(WIN32) && !defined(WATT32) #include #else - #include #include #include #include diff --git a/adig.c b/adig.c index 19f6057..4783101 100644 --- a/adig.c +++ b/adig.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif @@ -37,9 +34,6 @@ # include #endif -#ifdef HAVE_UNISTD_H -# include -#endif #ifdef HAVE_STRINGS_H # include #endif diff --git a/ahost.c b/ahost.c index d415964..cb2bea1 100644 --- a/ahost.c +++ b/ahost.c @@ -17,14 +17,11 @@ #include "ares_setup.h" #if !defined(WIN32) || defined(WATT32) -#include #include #include #include -#ifdef HAVE_UNISTD_H -#include -#endif #endif + #ifdef HAVE_STRINGS_H #include #endif diff --git a/ares__close_sockets.c b/ares__close_sockets.c index e819e7d..d3d85ff 100644 --- a/ares__close_sockets.c +++ b/ares__close_sockets.c @@ -16,10 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_UNISTD_H -#include -#endif - #include "ares.h" #include "ares_private.h" diff --git a/ares__get_hostent.c b/ares__get_hostent.c index 94428ee..a9a80ef 100644 --- a/ares__get_hostent.c +++ b/ares__get_hostent.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_create_query.c b/ares_create_query.c index f41a0ef..8624e2f 100644 --- a/ares_create_query.c +++ b/ares_create_query.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_expand_name.c b/ares_expand_name.c index e69f1af..a66dfa9 100644 --- a/ares_expand_name.c +++ b/ares_expand_name.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_expand_string.c b/ares_expand_string.c index e55f53b..96d1be3 100644 --- a/ares_expand_string.c +++ b/ares_expand_string.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_gethostbyaddr.c b/ares_gethostbyaddr.c index 9971c4f..669a29d 100644 --- a/ares_gethostbyaddr.c +++ b/ares_gethostbyaddr.c @@ -15,9 +15,6 @@ */ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_gethostbyname.c b/ares_gethostbyname.c index 90f03a2..428b1ee 100644 --- a/ares_gethostbyname.c +++ b/ares_gethostbyname.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_getnameinfo.c b/ares_getnameinfo.c index 351fb08..75cb7ed 100644 --- a/ares_getnameinfo.c +++ b/ares_getnameinfo.c @@ -22,9 +22,6 @@ # endif #endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif @@ -47,10 +44,6 @@ #include #endif -#ifdef HAVE_UNISTD_H -#include -#endif - #include "ares.h" #include "ares_ipv6.h" #include "inet_ntop.h" diff --git a/ares_init.c b/ares_init.c index 15d2934..aab1a50 100644 --- a/ares_init.c +++ b/ares_init.c @@ -21,10 +21,6 @@ #include #endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - #ifdef HAVE_NETINET_IN_H #include #endif @@ -46,10 +42,6 @@ # include #endif -#ifdef HAVE_UNISTD_H -#include -#endif - #if defined(ANDROID) || defined(__ANDROID__) #include /* From the Bionic sources */ diff --git a/ares_nowarn.c b/ares_nowarn.c index dc33bcf..a4dce89 100644 --- a/ares_nowarn.c +++ b/ares_nowarn.c @@ -23,9 +23,6 @@ #if defined(__INTEL_COMPILER) && defined(__unix__) -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_parse_a_reply.c b/ares_parse_a_reply.c index 641ae79..9683ef5 100644 --- a/ares_parse_a_reply.c +++ b/ares_parse_a_reply.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_parse_aaaa_reply.c b/ares_parse_aaaa_reply.c index d23676a..f5b6eae 100644 --- a/ares_parse_aaaa_reply.c +++ b/ares_parse_aaaa_reply.c @@ -17,9 +17,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_parse_mx_reply.c b/ares_parse_mx_reply.c index bc5e812..32d3af4 100644 --- a/ares_parse_mx_reply.c +++ b/ares_parse_mx_reply.c @@ -17,9 +17,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_parse_naptr_reply.c b/ares_parse_naptr_reply.c index 73a57a0..9315df7 100644 --- a/ares_parse_naptr_reply.c +++ b/ares_parse_naptr_reply.c @@ -17,9 +17,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_parse_ns_reply.c b/ares_parse_ns_reply.c index 1a4e801..553f253 100644 --- a/ares_parse_ns_reply.c +++ b/ares_parse_ns_reply.c @@ -20,9 +20,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_parse_ptr_reply.c b/ares_parse_ptr_reply.c index bb62b67..b505b92 100644 --- a/ares_parse_ptr_reply.c +++ b/ares_parse_ptr_reply.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_parse_soa_reply.c b/ares_parse_soa_reply.c index 611a215..da1c6dc 100644 --- a/ares_parse_soa_reply.c +++ b/ares_parse_soa_reply.c @@ -17,9 +17,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_parse_srv_reply.c b/ares_parse_srv_reply.c index 6b2526c..9f61f19 100644 --- a/ares_parse_srv_reply.c +++ b/ares_parse_srv_reply.c @@ -17,9 +17,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_parse_txt_reply.c b/ares_parse_txt_reply.c index 26737ed..dcc6473 100644 --- a/ares_parse_txt_reply.c +++ b/ares_parse_txt_reply.c @@ -17,9 +17,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_process.c b/ares_process.c index 25eb24c..2a02f16 100644 --- a/ares_process.c +++ b/ares_process.c @@ -17,9 +17,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_SYS_UIO_H # include #endif @@ -44,9 +41,6 @@ #ifdef HAVE_STRINGS_H # include #endif -#ifdef HAVE_UNISTD_H -# include -#endif #ifdef HAVE_SYS_IOCTL_H # include #endif diff --git a/ares_query.c b/ares_query.c index 6104128..31084da 100644 --- a/ares_query.c +++ b/ares_query.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/ares_send.c b/ares_send.c index ab85a2d..1a450b1 100644 --- a/ares_send.c +++ b/ares_send.c @@ -16,9 +16,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/inet_net_pton.c b/inet_net_pton.c index f4e58f9..8199934 100644 --- a/inet_net_pton.c +++ b/inet_net_pton.c @@ -18,9 +18,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/inet_ntop.c b/inet_ntop.c index e5ffb10..ea1ebb8 100644 --- a/inet_ntop.c +++ b/inet_ntop.c @@ -17,9 +17,6 @@ #include "ares_setup.h" -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif diff --git a/setup_once.h b/setup_once.h index bb261e7..3dad534 100644 --- a/setup_once.h +++ b/setup_once.h @@ -76,6 +76,14 @@ #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + /* * Definition of timeval struct for platforms that don't have it. -- cgit v1.2.3