diff options
author | Rosen Penev <rosenp@gmail.com> | 2022-04-01 21:14:53 -0700 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-04-04 07:49:52 +0200 |
commit | 0498e99f7f0105cb412e0ed8042eda8005d5cd6f (patch) | |
tree | 3eee97806cfcf26b2561cc4ad223828babdb8f58 /src | |
parent | 06819f2e894405e691bd8532b60836f32468f12c (diff) | |
download | libmicrohttpd-0498e99f7f0105cb412e0ed8042eda8005d5cd6f.tar.gz libmicrohttpd-0498e99f7f0105cb412e0ed8042eda8005d5cd6f.zip |
use ifdef for several HAVE header macros
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/platform.h | 18 | ||||
-rw-r--r-- | src/lib/daemon_ip_limit.c | 6 | ||||
-rw-r--r-- | src/lib/daemon_options.c | 2 | ||||
-rw-r--r-- | src/lib/daemon_start.c | 10 | ||||
-rw-r--r-- | src/lib/mhd_byteorder.h | 18 | ||||
-rw-r--r-- | src/lib/sysfdsetsize.c | 10 |
6 files changed, 32 insertions, 32 deletions
diff --git a/src/include/platform.h b/src/include/platform.h index b5861d25..4376636e 100644 --- a/src/include/platform.h +++ b/src/include/platform.h | |||
@@ -70,32 +70,32 @@ | |||
70 | #endif /* HAVE_INETLIB_H */ | 70 | #endif /* HAVE_INETLIB_H */ |
71 | #endif /* __VXWORKS__ */ | 71 | #endif /* __VXWORKS__ */ |
72 | 72 | ||
73 | #if HAVE_MEMORY_H | 73 | #ifdef HAVE_MEMORY_H |
74 | #include <memory.h> | 74 | #include <memory.h> |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | #if HAVE_SYS_SELECT_H | 77 | #ifdef HAVE_SYS_SELECT_H |
78 | #include <sys/select.h> | 78 | #include <sys/select.h> |
79 | #endif | 79 | #endif |
80 | #if HAVE_SYS_TYPES_H | 80 | #ifdef HAVE_SYS_TYPES_H |
81 | #include <sys/types.h> | 81 | #include <sys/types.h> |
82 | #endif | 82 | #endif |
83 | #if HAVE_SYS_TIME_H | 83 | #ifdef HAVE_SYS_TIME_H |
84 | #include <sys/time.h> | 84 | #include <sys/time.h> |
85 | #endif | 85 | #endif |
86 | #if HAVE_SYS_STAT_H | 86 | #ifdef HAVE_SYS_STAT_H |
87 | #include <sys/stat.h> | 87 | #include <sys/stat.h> |
88 | #endif | 88 | #endif |
89 | #if HAVE_SYS_MSG_H | 89 | #ifdef HAVE_SYS_MSG_H |
90 | #include <sys/msg.h> | 90 | #include <sys/msg.h> |
91 | #endif | 91 | #endif |
92 | #if HAVE_SYS_MMAN_H | 92 | #ifdef HAVE_SYS_MMAN_H |
93 | #include <sys/mman.h> | 93 | #include <sys/mman.h> |
94 | #endif | 94 | #endif |
95 | #if HAVE_TIME_H | 95 | #ifdef HAVE_TIME_H |
96 | #include <time.h> | 96 | #include <time.h> |
97 | #endif | 97 | #endif |
98 | #if HAVE_SYS_SOCKET_H | 98 | #ifdef HAVE_SYS_SOCKET_H |
99 | #include <sys/socket.h> | 99 | #include <sys/socket.h> |
100 | #endif | 100 | #endif |
101 | #if defined(_WIN32) && ! defined(__CYGWIN__) | 101 | #if defined(_WIN32) && ! defined(__CYGWIN__) |
diff --git a/src/lib/daemon_ip_limit.c b/src/lib/daemon_ip_limit.c index e8af56d8..91fc06ea 100644 --- a/src/lib/daemon_ip_limit.c +++ b/src/lib/daemon_ip_limit.c | |||
@@ -24,7 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | #include "internal.h" | 25 | #include "internal.h" |
26 | #include "daemon_ip_limit.h" | 26 | #include "daemon_ip_limit.h" |
27 | #if HAVE_SEARCH_H | 27 | #ifdef HAVE_SEARCH_H |
28 | #include <search.h> | 28 | #include <search.h> |
29 | #else | 29 | #else |
30 | #include "tsearch.h" | 30 | #include "tsearch.h" |
@@ -50,7 +50,7 @@ struct MHD_IPCount | |||
50 | * IPv4 address. | 50 | * IPv4 address. |
51 | */ | 51 | */ |
52 | struct in_addr ipv4; | 52 | struct in_addr ipv4; |
53 | #if HAVE_INET6 | 53 | #ifdef HAVE_INET6 |
54 | /** | 54 | /** |
55 | * IPv6 address. | 55 | * IPv6 address. |
56 | */ | 56 | */ |
@@ -154,7 +154,7 @@ MHD_ip_addr_to_key (const struct sockaddr *addr, | |||
154 | return MHD_YES; | 154 | return MHD_YES; |
155 | } | 155 | } |
156 | 156 | ||
157 | #if HAVE_INET6 | 157 | #ifdef HAVE_INET6 |
158 | /* IPv6 addresses */ | 158 | /* IPv6 addresses */ |
159 | if (sizeof (struct sockaddr_in6) == addrlen) | 159 | if (sizeof (struct sockaddr_in6) == addrlen) |
160 | { | 160 | { |
diff --git a/src/lib/daemon_options.c b/src/lib/daemon_options.c index abf1fbd3..531e4222 100644 --- a/src/lib/daemon_options.c +++ b/src/lib/daemon_options.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * @author Christian Grothoff | 23 | * @author Christian Grothoff |
24 | */ | 24 | */ |
25 | #include "internal.h" | 25 | #include "internal.h" |
26 | #if HAVE_DLFCN_H | 26 | #ifdef HAVE_DLFCN_H |
27 | #include <dlfcn.h> | 27 | #include <dlfcn.h> |
28 | #endif | 28 | #endif |
29 | 29 | ||
diff --git a/src/lib/daemon_start.c b/src/lib/daemon_start.c index e2998f9d..be3191da 100644 --- a/src/lib/daemon_start.c +++ b/src/lib/daemon_start.c | |||
@@ -199,7 +199,7 @@ open_listen_socket (struct MHD_Daemon *daemon) | |||
199 | } /* switch on ss_family */ | 199 | } /* switch on ss_family */ |
200 | break; /* MHD_AF_NONE */ | 200 | break; /* MHD_AF_NONE */ |
201 | case MHD_AF_AUTO: | 201 | case MHD_AF_AUTO: |
202 | #if HAVE_INET6 | 202 | #ifdef HAVE_INET6 |
203 | pf = PF_INET6; | 203 | pf = PF_INET6; |
204 | use_v6 = true; | 204 | use_v6 = true; |
205 | #else | 205 | #else |
@@ -213,7 +213,7 @@ open_listen_socket (struct MHD_Daemon *daemon) | |||
213 | break; | 213 | break; |
214 | case MHD_AF_INET6: | 214 | case MHD_AF_INET6: |
215 | case MHD_AF_DUAL: | 215 | case MHD_AF_DUAL: |
216 | #if HAVE_INET6 | 216 | #ifdef HAVE_INET6 |
217 | pf = PF_INET6; | 217 | pf = PF_INET6; |
218 | use_v6 = true; | 218 | use_v6 = true; |
219 | break; | 219 | break; |
@@ -296,7 +296,7 @@ try_open_listen_socket: | |||
296 | else | 296 | else |
297 | { | 297 | { |
298 | /* Compute bind address based on port and AF */ | 298 | /* Compute bind address based on port and AF */ |
299 | #if HAVE_INET6 | 299 | #ifdef HAVE_INET6 |
300 | if (use_v6) | 300 | if (use_v6) |
301 | { | 301 | { |
302 | #ifdef IN6ADDR_ANY_INIT | 302 | #ifdef IN6ADDR_ANY_INIT |
@@ -633,7 +633,7 @@ MHD_polling_thread (void *cls) | |||
633 | MHD_YES); | 633 | MHD_YES); |
634 | break; | 634 | break; |
635 | case MHD_ELS_POLL: | 635 | case MHD_ELS_POLL: |
636 | #if HAVE_POLL | 636 | #ifdef HAVE_POLL |
637 | MHD_daemon_poll_ (daemon, | 637 | MHD_daemon_poll_ (daemon, |
638 | MHD_YES); | 638 | MHD_YES); |
639 | #else | 639 | #else |
@@ -834,7 +834,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon) | |||
834 | daemon->event_loop_syscall = MHD_ELS_POLL; | 834 | daemon->event_loop_syscall = MHD_ELS_POLL; |
835 | else | 835 | else |
836 | daemon->event_loop_syscall = MHD_ELS_EPOLL; | 836 | daemon->event_loop_syscall = MHD_ELS_EPOLL; |
837 | #elif HAVE_POLL | 837 | #elif defined(HAVE_POLL) |
838 | daemon->event_loop_syscall = MHD_ELS_POLL; | 838 | daemon->event_loop_syscall = MHD_ELS_POLL; |
839 | #else | 839 | #else |
840 | daemon->event_loop_syscall = MHD_ELS_SELECT; | 840 | daemon->event_loop_syscall = MHD_ELS_SELECT; |
diff --git a/src/lib/mhd_byteorder.h b/src/lib/mhd_byteorder.h index 442e8e17..5e6d9727 100644 --- a/src/lib/mhd_byteorder.h +++ b/src/lib/mhd_byteorder.h | |||
@@ -28,39 +28,39 @@ | |||
28 | 28 | ||
29 | #include "platform.h" | 29 | #include "platform.h" |
30 | 30 | ||
31 | #if HAVE_ENDIAN_H | 31 | #ifdef HAVE_ENDIAN_H |
32 | #include <endian.h> | 32 | #include <endian.h> |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #if HAVE_SYS_PARAM_H | 35 | #ifdef HAVE_SYS_PARAM_H |
36 | #include <sys/param.h> | 36 | #include <sys/param.h> |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #if HAVE_MACHINE_ENDIAN_H | 39 | #ifdef HAVE_MACHINE_ENDIAN_H |
40 | #include <machine/endian.h> | 40 | #include <machine/endian.h> |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #if HAVE_SYS_ENDIAN_H | 43 | #ifdef HAVE_SYS_ENDIAN_H |
44 | #include <sys/endian.h> | 44 | #include <sys/endian.h> |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #if HAVE_SYS_TYPES_H | 47 | #ifdef HAVE_SYS_TYPES_H |
48 | #include <sys/types.h> | 48 | #include <sys/types.h> |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #if HAVE_SYS_BYTEORDER_H | 51 | #ifdef HAVE_SYS_BYTEORDER_H |
52 | #include <sys/byteorder.h> | 52 | #include <sys/byteorder.h> |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #if HAVE_SYS_MACHINE_H | 55 | #ifdef HAVE_SYS_MACHINE_H |
56 | #include <sys/machine.h> | 56 | #include <sys/machine.h> |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #if HAVE_MACHINE_PARAM_H | 59 | #ifdef HAVE_MACHINE_PARAM_H |
60 | #include <machine/param.h> | 60 | #include <machine/param.h> |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | #if HAVE_SYS_ISA_DEFS_H | 63 | #ifdef HAVE_SYS_ISA_DEFS_H |
64 | #include <sys/isa_defs.h> | 64 | #include <sys/isa_defs.h> |
65 | #endif | 65 | #endif |
66 | 66 | ||
diff --git a/src/lib/sysfdsetsize.c b/src/lib/sysfdsetsize.c index 4929b3d2..350bfd5e 100644 --- a/src/lib/sysfdsetsize.c +++ b/src/lib/sysfdsetsize.c | |||
@@ -37,22 +37,22 @@ | |||
37 | #if defined(__VXWORKS__) || defined(__vxworks) || defined(OS_VXWORKS) | 37 | #if defined(__VXWORKS__) || defined(__vxworks) || defined(OS_VXWORKS) |
38 | #include <sockLib.h> | 38 | #include <sockLib.h> |
39 | #endif /* OS_VXWORKS */ | 39 | #endif /* OS_VXWORKS */ |
40 | #if HAVE_SYS_SELECT_H | 40 | #ifdef HAVE_SYS_SELECT_H |
41 | #include <sys/select.h> | 41 | #include <sys/select.h> |
42 | #endif /* HAVE_SYS_SELECT_H */ | 42 | #endif /* HAVE_SYS_SELECT_H */ |
43 | #if HAVE_SYS_TYPES_H | 43 | #ifdef HAVE_SYS_TYPES_H |
44 | #include <sys/types.h> | 44 | #include <sys/types.h> |
45 | #endif /* HAVE_SYS_TYPES_H */ | 45 | #endif /* HAVE_SYS_TYPES_H */ |
46 | #if HAVE_SYS_TIME_H | 46 | #ifdef HAVE_SYS_TIME_H |
47 | #include <sys/time.h> | 47 | #include <sys/time.h> |
48 | #endif /* HAVE_SYS_TIME_H */ | 48 | #endif /* HAVE_SYS_TIME_H */ |
49 | #if HAVE_TIME_H | 49 | #ifdef HAVE_TIME_H |
50 | #include <time.h> | 50 | #include <time.h> |
51 | #endif /* HAVE_TIME_H */ | 51 | #endif /* HAVE_TIME_H */ |
52 | #ifdef HAVE_UNISTD_H | 52 | #ifdef HAVE_UNISTD_H |
53 | #include <unistd.h> | 53 | #include <unistd.h> |
54 | #endif /* HAVE_UNISTD_H */ | 54 | #endif /* HAVE_UNISTD_H */ |
55 | #if HAVE_SYS_SOCKET_H | 55 | #ifdef HAVE_SYS_SOCKET_H |
56 | #include <sys/socket.h> | 56 | #include <sys/socket.h> |
57 | #endif /* HAVE_SYS_SOCKET_H */ | 57 | #endif /* HAVE_SYS_SOCKET_H */ |
58 | 58 | ||