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