Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

setup_once.h: refactor inclusion of <unistd.h> and <sys/socket.h>

Inclusion of these two header files now done in setup_once.h
  • Loading branch information...
commit 0c677f578e8be6050c976f3923b833fbe8fc9cfb 1 parent a103527
yangtse yangtse authored
4 acountry.c
@@ -34,9 +34,6 @@
34 34
35 35 #include "ares_setup.h"
36 36
37   -#ifdef HAVE_UNISTD_H
38   -#include <unistd.h>
39   -#endif
40 37 #ifdef HAVE_STRINGS_H
41 38 #include <strings.h>
42 39 #endif
@@ -44,7 +41,6 @@
44 41 #if defined(WIN32) && !defined(WATT32)
45 42 #include <winsock.h>
46 43 #else
47   - #include <sys/socket.h>
48 44 #include <arpa/inet.h>
49 45 #include <netinet/in.h>
50 46 #include <netdb.h>
6 adig.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
@@ -37,9 +34,6 @@
37 34 # include <arpa/nameser_compat.h>
38 35 #endif
39 36
40   -#ifdef HAVE_UNISTD_H
41   -# include <unistd.h>
42   -#endif
43 37 #ifdef HAVE_STRINGS_H
44 38 # include <strings.h>
45 39 #endif
5 ahost.c
@@ -17,14 +17,11 @@
17 17 #include "ares_setup.h"
18 18
19 19 #if !defined(WIN32) || defined(WATT32)
20   -#include <sys/socket.h>
21 20 #include <netinet/in.h>
22 21 #include <arpa/inet.h>
23 22 #include <netdb.h>
24   -#ifdef HAVE_UNISTD_H
25   -#include <unistd.h>
26   -#endif
27 23 #endif
  24 +
28 25 #ifdef HAVE_STRINGS_H
29 26 #include <strings.h>
30 27 #endif
4 ares__close_sockets.c
@@ -16,10 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_UNISTD_H
20   -#include <unistd.h>
21   -#endif
22   -
23 19 #include "ares.h"
24 20 #include "ares_private.h"
25 21
3  ares__get_hostent.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
3  ares_create_query.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
3  ares_expand_name.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
3  ares_expand_string.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
3  ares_gethostbyaddr.c
@@ -15,9 +15,6 @@
15 15 */
16 16 #include "ares_setup.h"
17 17
18   -#ifdef HAVE_SYS_SOCKET_H
19   -# include <sys/socket.h>
20   -#endif
21 18 #ifdef HAVE_NETINET_IN_H
22 19 # include <netinet/in.h>
23 20 #endif
3  ares_gethostbyname.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
7 ares_getnameinfo.c
@@ -22,9 +22,6 @@
22 22 # endif
23 23 #endif
24 24
25   -#ifdef HAVE_SYS_SOCKET_H
26   -# include <sys/socket.h>
27   -#endif
28 25 #ifdef HAVE_NETINET_IN_H
29 26 # include <netinet/in.h>
30 27 #endif
@@ -47,10 +44,6 @@
47 44 #include <net/if.h>
48 45 #endif
49 46
50   -#ifdef HAVE_UNISTD_H
51   -#include <unistd.h>
52   -#endif
53   -
54 47 #include "ares.h"
55 48 #include "ares_ipv6.h"
56 49 #include "inet_ntop.h"
8 ares_init.c
@@ -21,10 +21,6 @@
21 21 #include <sys/param.h>
22 22 #endif
23 23
24   -#ifdef HAVE_SYS_SOCKET_H
25   -#include <sys/socket.h>
26   -#endif
27   -
28 24 #ifdef HAVE_NETINET_IN_H
29 25 #include <netinet/in.h>
30 26 #endif
@@ -46,10 +42,6 @@
46 42 # include <arpa/nameser_compat.h>
47 43 #endif
48 44
49   -#ifdef HAVE_UNISTD_H
50   -#include <unistd.h>
51   -#endif
52   -
53 45 #if defined(ANDROID) || defined(__ANDROID__)
54 46 #include <sys/system_properties.h>
55 47 /* From the Bionic sources */
3  ares_nowarn.c
@@ -23,9 +23,6 @@
23 23
24 24 #if defined(__INTEL_COMPILER) && defined(__unix__)
25 25
26   -#ifdef HAVE_SYS_SOCKET_H
27   -# include <sys/socket.h>
28   -#endif
29 26 #ifdef HAVE_NETINET_IN_H
30 27 # include <netinet/in.h>
31 28 #endif
3  ares_parse_a_reply.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
3  ares_parse_aaaa_reply.c
@@ -17,9 +17,6 @@
17 17
18 18 #include "ares_setup.h"
19 19
20   -#ifdef HAVE_SYS_SOCKET_H
21   -# include <sys/socket.h>
22   -#endif
23 20 #ifdef HAVE_NETINET_IN_H
24 21 # include <netinet/in.h>
25 22 #endif
3  ares_parse_mx_reply.c
@@ -17,9 +17,6 @@
17 17
18 18 #include "ares_setup.h"
19 19
20   -#ifdef HAVE_SYS_SOCKET_H
21   -# include <sys/socket.h>
22   -#endif
23 20 #ifdef HAVE_NETINET_IN_H
24 21 # include <netinet/in.h>
25 22 #endif
3  ares_parse_naptr_reply.c
@@ -17,9 +17,6 @@
17 17
18 18 #include "ares_setup.h"
19 19
20   -#ifdef HAVE_SYS_SOCKET_H
21   -# include <sys/socket.h>
22   -#endif
23 20 #ifdef HAVE_NETINET_IN_H
24 21 # include <netinet/in.h>
25 22 #endif
3  ares_parse_ns_reply.c
@@ -20,9 +20,6 @@
20 20
21 21 #include "ares_setup.h"
22 22
23   -#ifdef HAVE_SYS_SOCKET_H
24   -# include <sys/socket.h>
25   -#endif
26 23 #ifdef HAVE_NETINET_IN_H
27 24 # include <netinet/in.h>
28 25 #endif
3  ares_parse_ptr_reply.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
3  ares_parse_soa_reply.c
@@ -17,9 +17,6 @@
17 17
18 18 #include "ares_setup.h"
19 19
20   -#ifdef HAVE_SYS_SOCKET_H
21   -# include <sys/socket.h>
22   -#endif
23 20 #ifdef HAVE_NETINET_IN_H
24 21 # include <netinet/in.h>
25 22 #endif
3  ares_parse_srv_reply.c
@@ -17,9 +17,6 @@
17 17
18 18 #include "ares_setup.h"
19 19
20   -#ifdef HAVE_SYS_SOCKET_H
21   -# include <sys/socket.h>
22   -#endif
23 20 #ifdef HAVE_NETINET_IN_H
24 21 # include <netinet/in.h>
25 22 #endif
3  ares_parse_txt_reply.c
@@ -17,9 +17,6 @@
17 17
18 18 #include "ares_setup.h"
19 19
20   -#ifdef HAVE_SYS_SOCKET_H
21   -# include <sys/socket.h>
22   -#endif
23 20 #ifdef HAVE_NETINET_IN_H
24 21 # include <netinet/in.h>
25 22 #endif
6 ares_process.c
@@ -17,9 +17,6 @@
17 17
18 18 #include "ares_setup.h"
19 19
20   -#ifdef HAVE_SYS_SOCKET_H
21   -# include <sys/socket.h>
22   -#endif
23 20 #ifdef HAVE_SYS_UIO_H
24 21 # include <sys/uio.h>
25 22 #endif
@@ -44,9 +41,6 @@
44 41 #ifdef HAVE_STRINGS_H
45 42 # include <strings.h>
46 43 #endif
47   -#ifdef HAVE_UNISTD_H
48   -# include <unistd.h>
49   -#endif
50 44 #ifdef HAVE_SYS_IOCTL_H
51 45 # include <sys/ioctl.h>
52 46 #endif
3  ares_query.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
3  ares_send.c
@@ -16,9 +16,6 @@
16 16
17 17 #include "ares_setup.h"
18 18
19   -#ifdef HAVE_SYS_SOCKET_H
20   -# include <sys/socket.h>
21   -#endif
22 19 #ifdef HAVE_NETINET_IN_H
23 20 # include <netinet/in.h>
24 21 #endif
3  inet_net_pton.c
@@ -18,9 +18,6 @@
18 18
19 19 #include "ares_setup.h"
20 20
21   -#ifdef HAVE_SYS_SOCKET_H
22   -# include <sys/socket.h>
23   -#endif
24 21 #ifdef HAVE_NETINET_IN_H
25 22 # include <netinet/in.h>
26 23 #endif
3  inet_ntop.c
@@ -17,9 +17,6 @@
17 17
18 18 #include "ares_setup.h"
19 19
20   -#ifdef HAVE_SYS_SOCKET_H
21   -# include <sys/socket.h>
22   -#endif
23 20 #ifdef HAVE_NETINET_IN_H
24 21 # include <netinet/in.h>
25 22 #endif
8 setup_once.h
@@ -76,6 +76,14 @@
76 76 #include <stdbool.h>
77 77 #endif
78 78
  79 +#ifdef HAVE_UNISTD_H
  80 +#include <unistd.h>
  81 +#endif
  82 +
  83 +#ifdef HAVE_SYS_SOCKET_H
  84 +#include <sys/socket.h>
  85 +#endif
  86 +
79 87
80 88 /*
81 89 * Definition of timeval struct for platforms that don't have it.

0 comments on commit 0c677f5

Please sign in to comment.
Something went wrong with that request. Please try again.