xref: /curl/lib/config-win32.h (revision e411c98f)
1 #ifndef HEADER_CURL_CONFIG_WIN32_H
2 #define HEADER_CURL_CONFIG_WIN32_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at https://curl.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * SPDX-License-Identifier: curl
24  *
25  ***************************************************************************/
26 
27 /* ================================================================ */
28 /*               Hand crafted config file for Windows               */
29 /* ================================================================ */
30 
31 /* ---------------------------------------------------------------- */
32 /*                          HEADER FILES                            */
33 /* ---------------------------------------------------------------- */
34 
35 /* Define if you have the <arpa/inet.h> header file. */
36 /* #define HAVE_ARPA_INET_H 1 */
37 
38 /* Define if you have the <fcntl.h> header file. */
39 #define HAVE_FCNTL_H 1
40 
41 /* Define if you have the <io.h> header file. */
42 #define HAVE_IO_H 1
43 
44 /* Define if you have the <locale.h> header file. */
45 #define HAVE_LOCALE_H 1
46 
47 /* Define if you need <malloc.h> header even with <stdlib.h> header file. */
48 #define NEED_MALLOC_H 1
49 
50 /* Define if you have the <netdb.h> header file. */
51 /* #define HAVE_NETDB_H 1 */
52 
53 /* Define if you have the <netinet/in.h> header file. */
54 /* #define HAVE_NETINET_IN_H 1 */
55 
56 /* Define to 1 if you have the <stdbool.h> header file. */
57 #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
58 #define HAVE_STDBOOL_H 1
59 #endif
60 
61 /* Define if you have the <sys/param.h> header file. */
62 #if defined(__MINGW32__)
63 #define HAVE_SYS_PARAM_H 1
64 #endif
65 
66 /* Define if you have the <sys/select.h> header file. */
67 /* #define HAVE_SYS_SELECT_H 1 */
68 
69 /* Define if you have the <sys/socket.h> header file. */
70 /* #define HAVE_SYS_SOCKET_H 1 */
71 
72 /* Define if you have the <sys/sockio.h> header file. */
73 /* #define HAVE_SYS_SOCKIO_H 1 */
74 
75 /* Define if you have the <sys/stat.h> header file. */
76 #define HAVE_SYS_STAT_H 1
77 
78 /* Define if you have the <sys/time.h> header file. */
79 #if defined(__MINGW32__)
80 #define HAVE_SYS_TIME_H 1
81 #endif
82 
83 /* Define if you have the <sys/types.h> header file. */
84 #define HAVE_SYS_TYPES_H 1
85 
86 /* Define if you have the <sys/utime.h> header file. */
87 #define HAVE_SYS_UTIME_H 1
88 
89 /* Define if you have the <termio.h> header file. */
90 /* #define HAVE_TERMIO_H 1 */
91 
92 /* Define if you have the <termios.h> header file. */
93 /* #define HAVE_TERMIOS_H 1 */
94 
95 /* Define if you have the <unistd.h> header file. */
96 #if defined(__MINGW32__)
97 #define HAVE_UNISTD_H 1
98 #endif
99 
100 /* Define to 1 if you have the <libgen.h> header file. */
101 #if defined(__MINGW32__)
102 #define HAVE_LIBGEN_H 1
103 #endif
104 
105 /* ---------------------------------------------------------------- */
106 /*                        OTHER HEADER INFO                         */
107 /* ---------------------------------------------------------------- */
108 
109 /* Define if you have the ANSI C header files. */
110 #define STDC_HEADERS 1
111 
112 /* Define to 1 if bool is an available type. */
113 #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
114 #define HAVE_BOOL_T 1
115 #endif
116 
117 /* ---------------------------------------------------------------- */
118 /*                             FUNCTIONS                            */
119 /* ---------------------------------------------------------------- */
120 
121 /* Define if you have the closesocket function. */
122 #define HAVE_CLOSESOCKET 1
123 
124 /* Define if you have the ftruncate function. */
125 #if defined(__MINGW32__)
126 #define HAVE_FTRUNCATE 1
127 #endif
128 
129 /* Define to 1 if you have the `getpeername' function. */
130 #define HAVE_GETPEERNAME 1
131 
132 /* Define to 1 if you have the getsockname function. */
133 #define HAVE_GETSOCKNAME 1
134 
135 /* Define if you have the gethostname function. */
136 #define HAVE_GETHOSTNAME 1
137 
138 /* Define if you have the gettimeofday function. */
139 #if defined(__MINGW32__)
140 #define HAVE_GETTIMEOFDAY 1
141 #endif
142 
143 /* Define if you have the ioctlsocket function. */
144 #define HAVE_IOCTLSOCKET 1
145 
146 /* Define if you have a working ioctlsocket FIONBIO function. */
147 #define HAVE_IOCTLSOCKET_FIONBIO 1
148 
149 /* Define if you have the select function. */
150 #define HAVE_SELECT 1
151 
152 /* Define if you have the setlocale function. */
153 #define HAVE_SETLOCALE 1
154 
155 /* Define if you have the setmode function. */
156 #define HAVE_SETMODE 1
157 
158 /* Define if you have the socket function. */
159 #define HAVE_SOCKET 1
160 
161 /* Define if you have the strcasecmp function. */
162 #if defined(__MINGW32__)
163 #define HAVE_STRCASECMP 1
164 #endif
165 
166 /* Define if you have the strdup function. */
167 #define HAVE_STRDUP 1
168 
169 /* Define if you have the stricmp function. */
170 #define HAVE_STRICMP 1
171 
172 /* Define if you have the strtoll function. */
173 #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
174 #define HAVE_STRTOLL 1
175 #endif
176 
177 /* Define if you have the utime function. */
178 #define HAVE_UTIME 1
179 
180 /* Define if you have the recv function. */
181 #define HAVE_RECV 1
182 
183 /* Define to the type of arg 1 for recv. */
184 #define RECV_TYPE_ARG1 SOCKET
185 
186 /* Define to the type of arg 2 for recv. */
187 #define RECV_TYPE_ARG2 char *
188 
189 /* Define to the type of arg 3 for recv. */
190 #define RECV_TYPE_ARG3 int
191 
192 /* Define to the type of arg 4 for recv. */
193 #define RECV_TYPE_ARG4 int
194 
195 /* Define to the function return type for recv. */
196 #define RECV_TYPE_RETV int
197 
198 /* Define if you have the send function. */
199 #define HAVE_SEND 1
200 
201 /* Define to the type of arg 1 for send. */
202 #define SEND_TYPE_ARG1 SOCKET
203 
204 /* Define to the type qualifier of arg 2 for send. */
205 #define SEND_QUAL_ARG2 const
206 
207 /* Define to the type of arg 2 for send. */
208 #define SEND_TYPE_ARG2 char *
209 
210 /* Define to the type of arg 3 for send. */
211 #define SEND_TYPE_ARG3 int
212 
213 /* Define to the type of arg 4 for send. */
214 #define SEND_TYPE_ARG4 int
215 
216 /* Define to the function return type for send. */
217 #define SEND_TYPE_RETV int
218 
219 /* Define to 1 if you have the snprintf function. */
220 #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || defined(__MINGW32__)
221 #define HAVE_SNPRINTF 1
222 #endif
223 
224 #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600  /* Vista */
225 /* Define to 1 if you have a IPv6 capable working inet_ntop function. */
226 #define HAVE_INET_NTOP 1
227 /* Define to 1 if you have a IPv6 capable working inet_pton function. */
228 #define HAVE_INET_PTON 1
229 #endif
230 
231 /* Define to 1 if you have the `basename' function. */
232 #if defined(__MINGW32__)
233 #define HAVE_BASENAME 1
234 #endif
235 
236 /* Define to 1 if you have the strtok_r function. */
237 #if defined(__MINGW32__)
238 #define HAVE_STRTOK_R 1
239 #endif
240 
241 /* Define to 1 if you have the signal function. */
242 #define HAVE_SIGNAL 1
243 
244 /* ---------------------------------------------------------------- */
245 /*                       TYPEDEF REPLACEMENTS                       */
246 /* ---------------------------------------------------------------- */
247 
248 /* Define if in_addr_t is not an available 'typedefed' type. */
249 #define in_addr_t unsigned long
250 
251 /* Define if ssize_t is not an available 'typedefed' type. */
252 #ifndef _SSIZE_T_DEFINED
253 #  if defined(__MINGW32__)
254 #  elif defined(_WIN64)
255 #    define _SSIZE_T_DEFINED
256 #    define ssize_t __int64
257 #  else
258 #    define _SSIZE_T_DEFINED
259 #    define ssize_t int
260 #  endif
261 #endif
262 
263 /* ---------------------------------------------------------------- */
264 /*                            TYPE SIZES                            */
265 /* ---------------------------------------------------------------- */
266 
267 /* Define to the size of `int', as computed by sizeof. */
268 #define SIZEOF_INT 4
269 
270 /* Define to the size of `long long', as computed by sizeof. */
271 /* #define SIZEOF_LONG_LONG 8 */
272 
273 /* Define to the size of `long', as computed by sizeof. */
274 #define SIZEOF_LONG 4
275 
276 /* Define to the size of `size_t', as computed by sizeof. */
277 #if defined(_WIN64)
278 #  define SIZEOF_SIZE_T 8
279 #else
280 #  define SIZEOF_SIZE_T 4
281 #endif
282 
283 /* Define to the size of `curl_off_t', as computed by sizeof. */
284 #define SIZEOF_CURL_OFF_T 8
285 
286 /* ---------------------------------------------------------------- */
287 /*                        COMPILER SPECIFIC                         */
288 /* ---------------------------------------------------------------- */
289 
290 /* Define to nothing if compiler does not support 'const' qualifier. */
291 /* #define const */
292 
293 /* Define to nothing if compiler does not support 'volatile' qualifier. */
294 /* #define volatile */
295 
296 /* Windows should not have HAVE_GMTIME_R defined */
297 /* #undef HAVE_GMTIME_R */
298 
299 /* Define if the compiler supports the 'long long' data type. */
300 #if (defined(_MSC_VER) && (_MSC_VER >= 1310)) || defined(__MINGW32__)
301 #define HAVE_LONGLONG 1
302 #endif
303 
304 /* Define to avoid VS2005 complaining about portable C functions. */
305 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
306 #define _CRT_SECURE_NO_DEPRECATE 1
307 #define _CRT_NONSTDC_NO_DEPRECATE 1
308 #endif
309 
310 /* mingw-w64 and visual studio >= 2005 (MSVCR80)
311    all default to 64-bit time_t unless _USE_32BIT_TIME_T is defined */
312 #if (defined(_MSC_VER) && (_MSC_VER >= 1400)) || defined(__MINGW32__)
313 #  ifndef _USE_32BIT_TIME_T
314 #    define SIZEOF_TIME_T 8
315 #  else
316 #    define SIZEOF_TIME_T 4
317 #  endif
318 #endif
319 
320 /* Define some minimum and default build targets for Visual Studio */
321 #if defined(_MSC_VER)
322    /* Officially, Microsoft's Windows SDK versions 6.X does not support Windows
323       2000 as a supported build target. VS2008 default installations provides
324       an embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
325       valid build target for VS2008. Popular belief is that binaries built with
326       VS2008 using Windows SDK versions v6.X and Windows 2000 as a build target
327       are functional. */
328 #  define VS2008_MIN_TARGET 0x0500
329 
330    /* The minimum build target for VS2012 is Vista unless Update 1 is installed
331       and the v110_xp toolset is chosen. */
332 #  if defined(_USING_V110_SDK71_)
333 #    define VS2012_MIN_TARGET 0x0501
334 #  else
335 #    define VS2012_MIN_TARGET 0x0600
336 #  endif
337 
338    /* VS2008 default build target is Windows Vista. We override default target
339       to be Windows XP. */
340 #  define VS2008_DEF_TARGET 0x0501
341 
342    /* VS2012 default build target is Windows Vista unless Update 1 is installed
343       and the v110_xp toolset is chosen. */
344 #  if defined(_USING_V110_SDK71_)
345 #    define VS2012_DEF_TARGET 0x0501
346 #  else
347 #    define VS2012_DEF_TARGET 0x0600
348 #  endif
349 #endif
350 
351 /* VS2008 default target settings and minimum build target check. */
352 #if defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER <= 1600)
353 #  ifndef _WIN32_WINNT
354 #    define _WIN32_WINNT VS2008_DEF_TARGET
355 #  endif
356 #  ifndef WINVER
357 #    define WINVER VS2008_DEF_TARGET
358 #  endif
359 #  if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)
360 #    error VS2008 does not support Windows build targets prior to Windows 2000
361 #  endif
362 #endif
363 
364 /* VS2012 default target settings and minimum build target check. */
365 #if defined(_MSC_VER) && (_MSC_VER >= 1700)
366 #  ifndef _WIN32_WINNT
367 #    define _WIN32_WINNT VS2012_DEF_TARGET
368 #  endif
369 #  ifndef WINVER
370 #    define WINVER VS2012_DEF_TARGET
371 #  endif
372 #  if (_WIN32_WINNT < VS2012_MIN_TARGET) || (WINVER < VS2012_MIN_TARGET)
373 #    if defined(_USING_V110_SDK71_)
374 #      error VS2012 does not support Windows build targets prior to Windows XP
375 #    else
376 #      error VS2012 does not support Windows build targets prior to Windows \
377 Vista
378 #    endif
379 #  endif
380 #endif
381 
382 /* Windows XP is required for freeaddrinfo, getaddrinfo */
383 #define HAVE_FREEADDRINFO           1
384 #define HAVE_GETADDRINFO            1
385 #define HAVE_GETADDRINFO_THREADSAFE 1
386 
387 /* ---------------------------------------------------------------- */
388 /*                          STRUCT RELATED                          */
389 /* ---------------------------------------------------------------- */
390 
391 /* Define if you have struct sockaddr_storage. */
392 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
393 
394 /* Define if you have struct timeval. */
395 #define HAVE_STRUCT_TIMEVAL 1
396 
397 /* Define if struct sockaddr_in6 has the sin6_scope_id member. */
398 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
399 
400 /* ---------------------------------------------------------------- */
401 /*                        LARGE FILE SUPPORT                        */
402 /* ---------------------------------------------------------------- */
403 
404 #if defined(_MSC_VER) && !defined(_WIN32_WCE)
405 #  if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
406 #    define USE_WIN32_LARGE_FILES
407 #  else
408 #    define USE_WIN32_SMALL_FILES
409 #  endif
410 #endif
411 
412 #if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
413 #  define USE_WIN32_LARGE_FILES
414 #endif
415 
416 #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
417 #  define USE_WIN32_SMALL_FILES
418 #endif
419 
420 /* Number of bits in a file offset, on hosts where this is settable. */
421 #if defined(USE_WIN32_LARGE_FILES) && defined(__MINGW32__)
422 #  ifndef _FILE_OFFSET_BITS
423 #  define _FILE_OFFSET_BITS 64
424 #  endif
425 #endif
426 
427 #ifdef USE_WIN32_LARGE_FILES
428 #define HAVE__FSEEKI64
429 #endif
430 
431 /* Define to the size of `off_t', as computed by sizeof. */
432 #if defined(__MINGW32__) && \
433   defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
434 #  define SIZEOF_OFF_T 8
435 #else
436 #  define SIZEOF_OFF_T 4
437 #endif
438 
439 /* ---------------------------------------------------------------- */
440 /*                       DNS RESOLVER SPECIALTY                     */
441 /* ---------------------------------------------------------------- */
442 
443 /*
444  * Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS.
445  */
446 
447 /* Define to enable c-ares asynchronous DNS lookups. */
448 /* #define USE_ARES 1 */
449 
450 /* Default define to enable threaded asynchronous DNS lookups. */
451 #if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \
452     !defined(USE_THREADS_WIN32)
453 #  define USE_THREADS_WIN32 1
454 #endif
455 
456 #if defined(USE_ARES) && defined(USE_THREADS_WIN32)
457 #  error "Only one DNS lookup specialty may be defined at most"
458 #endif
459 
460 /* ---------------------------------------------------------------- */
461 /*                           LDAP SUPPORT                           */
462 /* ---------------------------------------------------------------- */
463 
464 #if defined(CURL_HAS_NOVELL_LDAPSDK)
465 #undef USE_WIN32_LDAP
466 #define HAVE_LDAP_SSL_H 1
467 #define HAVE_LDAP_URL_PARSE 1
468 #elif defined(CURL_HAS_OPENLDAP_LDAPSDK)
469 #undef USE_WIN32_LDAP
470 #define HAVE_LDAP_URL_PARSE 1
471 #else
472 #undef HAVE_LDAP_URL_PARSE
473 #define HAVE_LDAP_SSL 1
474 #define USE_WIN32_LDAP 1
475 #endif
476 
477 /* Define to use the Windows crypto library. */
478 #if !defined(CURL_WINDOWS_APP)
479 #define USE_WIN32_CRYPTO
480 #endif
481 
482 /* Define to use Unix sockets. */
483 #define USE_UNIX_SOCKETS
484 
485 /* ---------------------------------------------------------------- */
486 /*                       ADDITIONAL DEFINITIONS                     */
487 /* ---------------------------------------------------------------- */
488 
489 /* Define cpu-machine-OS */
490 #ifndef OS
491 #if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
492 #define OS "i386-pc-win32"
493 #elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (MSVC >=2005 or gcc) */
494 #define OS "x86_64-pc-win32"
495 #elif defined(_M_IA64) || defined(__ia64__) /* Itanium */
496 #define OS "ia64-pc-win32"
497 #elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 (Windows RT) */
498 #define OS "thumbv7a-pc-win32"
499 #elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */
500 #define OS "aarch64-pc-win32"
501 #else
502 #define OS "unknown-pc-win32"
503 #endif
504 #endif
505 
506 /* Name of package */
507 #define PACKAGE "curl"
508 
509 /* If you want to build curl with the built-in manual */
510 #define USE_MANUAL 1
511 
512 #endif /* HEADER_CURL_CONFIG_WIN32_H */
513