diff options
Diffstat (limited to 'src/lib/version.c')
-rw-r--r-- | src/lib/version.c | 155 |
1 files changed, 78 insertions, 77 deletions
diff --git a/src/lib/version.c b/src/lib/version.c index 472a8c04..5bf4ab01 100644 --- a/src/lib/version.c +++ b/src/lib/version.c | |||
@@ -40,13 +40,13 @@ MHD_get_version (void) | |||
40 | static char ver[12] = "\0\0\0\0\0\0\0\0\0\0\0"; | 40 | static char ver[12] = "\0\0\0\0\0\0\0\0\0\0\0"; |
41 | if (0 == ver[0]) | 41 | if (0 == ver[0]) |
42 | { | 42 | { |
43 | int res = MHD_snprintf_(ver, | 43 | int res = MHD_snprintf_ (ver, |
44 | sizeof(ver), | 44 | sizeof(ver), |
45 | "%x.%x.%x", | 45 | "%x.%x.%x", |
46 | (((int)MHD_VERSION >> 24) & 0xFF), | 46 | (((int) MHD_VERSION >> 24) & 0xFF), |
47 | (((int)MHD_VERSION >> 16) & 0xFF), | 47 | (((int) MHD_VERSION >> 16) & 0xFF), |
48 | (((int)MHD_VERSION >> 8) & 0xFF)); | 48 | (((int) MHD_VERSION >> 8) & 0xFF)); |
49 | if (0 >= res || sizeof(ver) <= res) | 49 | if ((0 >= res)||(sizeof(ver) <= res)) |
50 | return "0.0.0"; /* Can't return real version*/ | 50 | return "0.0.0"; /* Can't return real version*/ |
51 | } | 51 | } |
52 | return ver; | 52 | return ver; |
@@ -66,141 +66,142 @@ MHD_get_version (void) | |||
66 | * @ingroup specialized | 66 | * @ingroup specialized |
67 | */ | 67 | */ |
68 | _MHD_EXTERN enum MHD_Bool | 68 | _MHD_EXTERN enum MHD_Bool |
69 | MHD_is_feature_supported(enum MHD_Feature feature) | 69 | MHD_is_feature_supported (enum MHD_Feature feature) |
70 | { | 70 | { |
71 | switch(feature) | 71 | switch (feature) |
72 | { | 72 | { |
73 | case MHD_FEATURE_MESSAGES: | 73 | case MHD_FEATURE_MESSAGES: |
74 | #ifdef HAVE_MESSAGES | 74 | #ifdef HAVE_MESSAGES |
75 | return MHD_YES; | 75 | return MHD_YES; |
76 | #else | 76 | #else |
77 | return MHD_NO; | 77 | return MHD_NO; |
78 | #endif | 78 | #endif |
79 | case MHD_FEATURE_TLS: | 79 | case MHD_FEATURE_TLS: |
80 | #ifdef HTTPS_SUPPORT | 80 | #ifdef HTTPS_SUPPORT |
81 | return MHD_YES; | 81 | return MHD_YES; |
82 | #else /* ! HTTPS_SUPPORT */ | 82 | #else /* ! HTTPS_SUPPORT */ |
83 | return MHD_NO; | 83 | return MHD_NO; |
84 | #endif /* ! HTTPS_SUPPORT */ | 84 | #endif /* ! HTTPS_SUPPORT */ |
85 | case MHD_FEATURE_HTTPS_CERT_CALLBACK: | 85 | case MHD_FEATURE_HTTPS_CERT_CALLBACK: |
86 | #if defined(HTTPS_SUPPORT) && GNUTLS_VERSION_MAJOR >= 3 | 86 | #if defined(HTTPS_SUPPORT) && GNUTLS_VERSION_MAJOR >= 3 |
87 | return MHD_YES; | 87 | return MHD_YES; |
88 | #else /* !HTTPS_SUPPORT || GNUTLS_VERSION_MAJOR < 3 */ | 88 | #else /* !HTTPS_SUPPORT || GNUTLS_VERSION_MAJOR < 3 */ |
89 | return MHD_NO; | 89 | return MHD_NO; |
90 | #endif /* !HTTPS_SUPPORT || GNUTLS_VERSION_MAJOR < 3 */ | 90 | #endif /* !HTTPS_SUPPORT || GNUTLS_VERSION_MAJOR < 3 */ |
91 | case MHD_FEATURE_IPv6: | 91 | case MHD_FEATURE_IPv6: |
92 | #ifdef HAVE_INET6 | 92 | #ifdef HAVE_INET6 |
93 | return MHD_YES; | 93 | return MHD_YES; |
94 | #else | 94 | #else |
95 | return MHD_NO; | 95 | return MHD_NO; |
96 | #endif | 96 | #endif |
97 | case MHD_FEATURE_IPv6_ONLY: | 97 | case MHD_FEATURE_IPv6_ONLY: |
98 | #if defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY) | 98 | #if defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY) |
99 | return MHD_YES; | 99 | return MHD_YES; |
100 | #else | 100 | #else |
101 | return MHD_NO; | 101 | return MHD_NO; |
102 | #endif | 102 | #endif |
103 | case MHD_FEATURE_POLL: | 103 | case MHD_FEATURE_POLL: |
104 | #ifdef HAVE_POLL | 104 | #ifdef HAVE_POLL |
105 | return MHD_YES; | 105 | return MHD_YES; |
106 | #else | 106 | #else |
107 | return MHD_NO; | 107 | return MHD_NO; |
108 | #endif | 108 | #endif |
109 | case MHD_FEATURE_EPOLL: | 109 | case MHD_FEATURE_EPOLL: |
110 | #ifdef EPOLL_SUPPORT | 110 | #ifdef EPOLL_SUPPORT |
111 | return MHD_YES; | 111 | return MHD_YES; |
112 | #else | 112 | #else |
113 | return MHD_NO; | 113 | return MHD_NO; |
114 | #endif | 114 | #endif |
115 | case MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET: | 115 | case MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET: |
116 | #ifdef HAVE_LISTEN_SHUTDOWN | 116 | #ifdef HAVE_LISTEN_SHUTDOWN |
117 | return MHD_YES; | 117 | return MHD_YES; |
118 | #else | 118 | #else |
119 | return MHD_NO; | 119 | return MHD_NO; |
120 | #endif | 120 | #endif |
121 | case MHD_FEATURE_SOCKETPAIR: | 121 | case MHD_FEATURE_SOCKETPAIR: |
122 | #ifdef _MHD_ITC_SOCKETPAIR | 122 | #ifdef _MHD_ITC_SOCKETPAIR |
123 | return MHD_YES; | 123 | return MHD_YES; |
124 | #else | 124 | #else |
125 | return MHD_NO; | 125 | return MHD_NO; |
126 | #endif | 126 | #endif |
127 | case MHD_FEATURE_TCP_FASTOPEN: | 127 | case MHD_FEATURE_TCP_FASTOPEN: |
128 | #ifdef TCP_FASTOPEN | 128 | #ifdef TCP_FASTOPEN |
129 | return MHD_YES; | 129 | return MHD_YES; |
130 | #else | 130 | #else |
131 | return MHD_NO; | 131 | return MHD_NO; |
132 | #endif | 132 | #endif |
133 | case MHD_FEATURE_BASIC_AUTH: | 133 | case MHD_FEATURE_BASIC_AUTH: |
134 | #ifdef BAUTH_SUPPORT | 134 | #ifdef BAUTH_SUPPORT |
135 | return MHD_YES; | 135 | return MHD_YES; |
136 | #else | 136 | #else |
137 | return MHD_NO; | 137 | return MHD_NO; |
138 | #endif | 138 | #endif |
139 | case MHD_FEATURE_DIGEST_AUTH: | 139 | case MHD_FEATURE_DIGEST_AUTH: |
140 | #ifdef DAUTH_SUPPORT | 140 | #ifdef DAUTH_SUPPORT |
141 | return MHD_YES; | 141 | return MHD_YES; |
142 | #else | 142 | #else |
143 | return MHD_NO; | 143 | return MHD_NO; |
144 | #endif | 144 | #endif |
145 | case MHD_FEATURE_POSTPROCESSOR: | 145 | case MHD_FEATURE_POSTPROCESSOR: |
146 | #ifdef HAVE_POSTPROCESSOR | 146 | #ifdef HAVE_POSTPROCESSOR |
147 | return MHD_YES; | 147 | return MHD_YES; |
148 | #else | 148 | #else |
149 | return MHD_NO; | 149 | return MHD_NO; |
150 | #endif | 150 | #endif |
151 | case MHD_FEATURE_HTTPS_KEY_PASSWORD: | 151 | case MHD_FEATURE_HTTPS_KEY_PASSWORD: |
152 | #if defined(HTTPS_SUPPORT) && GNUTLS_VERSION_NUMBER >= 0x030111 | 152 | #if defined(HTTPS_SUPPORT) && GNUTLS_VERSION_NUMBER >= 0x030111 |
153 | return MHD_YES; | 153 | return MHD_YES; |
154 | #else /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030111 */ | 154 | #else /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030111 */ |
155 | return MHD_NO; | 155 | return MHD_NO; |
156 | #endif /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030111 */ | 156 | #endif /* !HTTPS_SUPPORT || GNUTLS_VERSION_NUMBER < 0x030111 */ |
157 | case MHD_FEATURE_LARGE_FILE: | 157 | case MHD_FEATURE_LARGE_FILE: |
158 | #if defined(HAVE_PREAD64) || defined(_WIN32) | 158 | #if defined(HAVE_PREAD64) || defined(_WIN32) |
159 | return MHD_YES; | 159 | return MHD_YES; |
160 | #elif defined(HAVE_PREAD) | 160 | #elif defined(HAVE_PREAD) |
161 | return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES; | 161 | return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES; |
162 | #elif defined(HAVE_LSEEK64) | 162 | #elif defined(HAVE_LSEEK64) |
163 | return MHD_YES; | 163 | return MHD_YES; |
164 | #else | 164 | #else |
165 | return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES; | 165 | return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES; |
166 | #endif | 166 | #endif |
167 | case MHD_FEATURE_THREAD_NAMES: | 167 | case MHD_FEATURE_THREAD_NAMES: |
168 | #if defined(MHD_USE_THREAD_NAME_) | 168 | #if defined(MHD_USE_THREAD_NAME_) |
169 | return MHD_YES; | 169 | return MHD_YES; |
170 | #else | 170 | #else |
171 | return MHD_NO; | 171 | return MHD_NO; |
172 | #endif | 172 | #endif |
173 | case MHD_FEATURE_UPGRADE: | 173 | case MHD_FEATURE_UPGRADE: |
174 | #if defined(UPGRADE_SUPPORT) | 174 | #if defined(UPGRADE_SUPPORT) |
175 | return MHD_YES; | 175 | return MHD_YES; |
176 | #else | 176 | #else |
177 | return MHD_NO; | 177 | return MHD_NO; |
178 | #endif | 178 | #endif |
179 | case MHD_FEATURE_RESPONSES_SHARED_FD: | 179 | case MHD_FEATURE_RESPONSES_SHARED_FD: |
180 | #if defined(HAVE_PREAD64) || defined(HAVE_PREAD) || defined(_WIN32) | 180 | #if defined(HAVE_PREAD64) || defined(HAVE_PREAD) || defined(_WIN32) |
181 | return MHD_YES; | 181 | return MHD_YES; |
182 | #else | 182 | #else |
183 | return MHD_NO; | 183 | return MHD_NO; |
184 | #endif | 184 | #endif |
185 | case MHD_FEATURE_AUTODETECT_BIND_PORT: | 185 | case MHD_FEATURE_AUTODETECT_BIND_PORT: |
186 | #ifdef MHD_USE_GETSOCKNAME | 186 | #ifdef MHD_USE_GETSOCKNAME |
187 | return MHD_YES; | 187 | return MHD_YES; |
188 | #else | 188 | #else |
189 | return MHD_NO; | 189 | return MHD_NO; |
190 | #endif | 190 | #endif |
191 | case MHD_FEATURE_AUTOSUPPRESS_SIGPIPE: | 191 | case MHD_FEATURE_AUTOSUPPRESS_SIGPIPE: |
192 | #if defined(MHD_WINSOCK_SOCKETS) || defined(MHD_socket_nosignal_) || defined (MSG_NOSIGNAL) | 192 | #if defined(MHD_WINSOCK_SOCKETS) || defined(MHD_socket_nosignal_) || \ |
193 | return MHD_YES; | 193 | defined (MSG_NOSIGNAL) |
194 | return MHD_YES; | ||
194 | #else | 195 | #else |
195 | return MHD_NO; | 196 | return MHD_NO; |
196 | #endif | 197 | #endif |
197 | case MHD_FEATURE_SENDFILE: | 198 | case MHD_FEATURE_SENDFILE: |
198 | #ifdef _MHD_HAVE_SENDFILE | 199 | #ifdef _MHD_HAVE_SENDFILE |
199 | return MHD_YES; | 200 | return MHD_YES; |
200 | #else | 201 | #else |
201 | return MHD_NO; | 202 | return MHD_NO; |
202 | #endif | 203 | #endif |
203 | 204 | ||
204 | } | 205 | } |
205 | return MHD_NO; | 206 | return MHD_NO; |
206 | } | 207 | } |