diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-11-30 15:52:03 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-12-01 15:05:56 +0300 |
commit | 3f634541483e4d0aa2a0346233ebafc4c1500707 (patch) | |
tree | 02fb441c7915877a611a4166e305598ea403b0f4 | |
parent | 969cbdf6a6ca12c1b4d2e960a37827e2fb23985e (diff) | |
download | libmicrohttpd-3f634541483e4d0aa2a0346233ebafc4c1500707.tar.gz libmicrohttpd-3f634541483e4d0aa2a0346233ebafc4c1500707.zip |
mhd_sockets: reordered includes for better compatibility
-rw-r--r-- | src/microhttpd/mhd_sockets.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h index ce9740e6..9ff2e372 100644 --- a/src/microhttpd/mhd_sockets.h +++ b/src/microhttpd/mhd_sockets.h | |||
@@ -42,6 +42,14 @@ | |||
42 | #include <unistd.h> | 42 | #include <unistd.h> |
43 | #endif /* HAVE_UNISTD_H */ | 43 | #endif /* HAVE_UNISTD_H */ |
44 | #include <fcntl.h> | 44 | #include <fcntl.h> |
45 | #ifdef HAVE_STDDEF_H | ||
46 | #include <stddef.h> | ||
47 | #endif /* HAVE_STDDEF_H */ | ||
48 | #if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED) | ||
49 | # include <stdint.h> | ||
50 | # define _SSIZE_T_DEFINED | ||
51 | typedef intptr_t ssize_t; | ||
52 | #endif /* !_SSIZE_T_DEFINED */ | ||
45 | 53 | ||
46 | #if ! defined(MHD_POSIX_SOCKETS) && ! defined(MHD_WINSOCK_SOCKETS) | 54 | #if ! defined(MHD_POSIX_SOCKETS) && ! defined(MHD_WINSOCK_SOCKETS) |
47 | # if ! defined(_WIN32) || defined(__CYGWIN__) | 55 | # if ! defined(_WIN32) || defined(__CYGWIN__) |
@@ -62,17 +70,26 @@ | |||
62 | # ifdef HAVE_SYS_TYPES_H | 70 | # ifdef HAVE_SYS_TYPES_H |
63 | # include <sys/types.h> /* required on old platforms */ | 71 | # include <sys/types.h> /* required on old platforms */ |
64 | # endif | 72 | # endif |
73 | # ifdef HAVE_SYS_TIME_H | ||
74 | # include <sys/time.h> | ||
75 | # endif | ||
76 | # ifdef HAVE_TIME_H | ||
77 | # include <time.h> | ||
78 | # endif | ||
79 | # ifdef HAVE_STRING_H | ||
80 | # include <string.h> /* for strerror() */ | ||
81 | # endif | ||
65 | # ifdef HAVE_SYS_SOCKET_H | 82 | # ifdef HAVE_SYS_SOCKET_H |
66 | # include <sys/socket.h> | 83 | # include <sys/socket.h> |
67 | # endif | 84 | # endif |
68 | # if defined(__VXWORKS__) || defined(__vxworks) || defined(OS_VXWORKS) | 85 | # if defined(__VXWORKS__) || defined(__vxworks) || defined(OS_VXWORKS) |
86 | # include <strings.h> /* required for FD_SET (bzero() function) */ | ||
69 | # ifdef HAVE_SOCKLIB_H | 87 | # ifdef HAVE_SOCKLIB_H |
70 | # include <sockLib.h> | 88 | # include <sockLib.h> |
71 | # endif /* HAVE_SOCKLIB_H */ | 89 | # endif /* HAVE_SOCKLIB_H */ |
72 | # ifdef HAVE_INETLIB_H | 90 | # ifdef HAVE_INETLIB_H |
73 | # include <inetLib.h> | 91 | # include <inetLib.h> |
74 | # endif /* HAVE_INETLIB_H */ | 92 | # endif /* HAVE_INETLIB_H */ |
75 | # include <strings.h> /* required for FD_SET (bzero() function) */ | ||
76 | # endif /* __VXWORKS__ || __vxworks || OS_VXWORKS */ | 93 | # endif /* __VXWORKS__ || __vxworks || OS_VXWORKS */ |
77 | # ifdef HAVE_NETINET_IN_H | 94 | # ifdef HAVE_NETINET_IN_H |
78 | # include <netinet/in.h> | 95 | # include <netinet/in.h> |
@@ -83,12 +100,6 @@ | |||
83 | # ifdef HAVE_NET_IF_H | 100 | # ifdef HAVE_NET_IF_H |
84 | # include <net/if.h> | 101 | # include <net/if.h> |
85 | # endif | 102 | # endif |
86 | # ifdef HAVE_SYS_TIME_H | ||
87 | # include <sys/time.h> | ||
88 | # endif | ||
89 | # ifdef HAVE_TIME_H | ||
90 | # include <time.h> | ||
91 | # endif | ||
92 | # ifdef HAVE_NETDB_H | 103 | # ifdef HAVE_NETDB_H |
93 | # include <netdb.h> | 104 | # include <netdb.h> |
94 | # endif | 105 | # endif |
@@ -102,9 +113,6 @@ | |||
102 | /* for TCP_FASTOPEN and TCP_CORK */ | 113 | /* for TCP_FASTOPEN and TCP_CORK */ |
103 | # include <netinet/tcp.h> | 114 | # include <netinet/tcp.h> |
104 | # endif | 115 | # endif |
105 | # ifdef HAVE_STRING_H | ||
106 | # include <string.h> /* for strerror() */ | ||
107 | # endif | ||
108 | #elif defined(MHD_WINSOCK_SOCKETS) | 116 | #elif defined(MHD_WINSOCK_SOCKETS) |
109 | # ifndef WIN32_LEAN_AND_MEAN | 117 | # ifndef WIN32_LEAN_AND_MEAN |
110 | # define WIN32_LEAN_AND_MEAN 1 | 118 | # define WIN32_LEAN_AND_MEAN 1 |
@@ -117,14 +125,6 @@ | |||
117 | # include <poll.h> | 125 | # include <poll.h> |
118 | #endif | 126 | #endif |
119 | 127 | ||
120 | #ifdef HAVE_STDDEF_H | ||
121 | #include <stddef.h> | ||
122 | #endif /* HAVE_STDDEF_H */ | ||
123 | #if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED) | ||
124 | # include <stdint.h> | ||
125 | # define _SSIZE_T_DEFINED | ||
126 | typedef intptr_t ssize_t; | ||
127 | #endif /* !_SSIZE_T_DEFINED */ | ||
128 | 128 | ||
129 | #ifdef __FreeBSD__ | 129 | #ifdef __FreeBSD__ |
130 | #include <sys/param.h> /* For __FreeBSD_version */ | 130 | #include <sys/param.h> /* For __FreeBSD_version */ |