1 #ifndef HEADER_CURL_CONFIG_WIN32_H
2 #define HEADER_CURL_CONFIG_WIN32_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
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 http://curl.haxx.se/docs/copyright.html.
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.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 ***************************************************************************/
25 /* ================================================================ */
26 /* Hand crafted config file for Windows */
27 /* ================================================================ */
29 /* ---------------------------------------------------------------- */
31 /* ---------------------------------------------------------------- */
33 /* Define if you have the <arpa/inet.h> header file. */
34 /* #define HAVE_ARPA_INET_H 1 */
36 /* Define if you have the <assert.h> header file. */
37 #define HAVE_ASSERT_H 1
39 /* Define if you have the <crypto.h> header file. */
40 /* #define HAVE_CRYPTO_H 1 */
42 /* Define if you have the <errno.h> header file. */
43 #define HAVE_ERRNO_H 1
45 /* Define if you have the <err.h> header file. */
46 /* #define HAVE_ERR_H 1 */
48 /* Define if you have the <fcntl.h> header file. */
49 #define HAVE_FCNTL_H 1
51 /* Define if you have the <getopt.h> header file. */
52 /* #define HAVE_GETOPT_H 1 */
54 /* Define if you have the <io.h> header file. */
57 /* Define if you have the <limits.h> header file. */
58 #define HAVE_LIMITS_H 1
60 /* Define if you have the <locale.h> header file. */
61 #define HAVE_LOCALE_H 1
63 /* Define if you need the malloc.h header file even with stdlib.h */
64 #if !defined(__SALFORDC__) && !defined(__POCC__)
65 #define NEED_MALLOC_H 1
68 /* Define if you have the <netdb.h> header file. */
69 /* #define HAVE_NETDB_H 1 */
71 /* Define if you have the <netinet/in.h> header file. */
72 /* #define HAVE_NETINET_IN_H 1 */
74 /* Define if you have the <process.h> header file. */
76 #define HAVE_PROCESS_H 1
79 /* Define if you have the <signal.h> header file. */
80 #define HAVE_SIGNAL_H 1
82 /* Define if you have the <sgtty.h> header file. */
83 /* #define HAVE_SGTTY_H 1 */
85 /* Define if you have the <ssl.h> header file. */
86 /* #define HAVE_SSL_H 1 */
88 /* Define if you have the <stdlib.h> header file. */
89 #define HAVE_STDLIB_H 1
91 /* Define if you have the <sys/param.h> header file. */
92 /* #define HAVE_SYS_PARAM_H 1 */
94 /* Define if you have the <sys/select.h> header file. */
95 /* #define HAVE_SYS_SELECT_H 1 */
97 /* Define if you have the <sys/socket.h> header file. */
98 /* #define HAVE_SYS_SOCKET_H 1 */
100 /* Define if you have the <sys/sockio.h> header file. */
101 /* #define HAVE_SYS_SOCKIO_H 1 */
103 /* Define if you have the <sys/stat.h> header file. */
104 #define HAVE_SYS_STAT_H 1
106 /* Define if you have the <sys/time.h> header file */
107 /* #define HAVE_SYS_TIME_H 1 */
109 /* Define if you have the <sys/types.h> header file. */
110 #define HAVE_SYS_TYPES_H 1
112 /* Define if you have the <sys/utime.h> header file. */
114 #define HAVE_SYS_UTIME_H 1
117 /* Define if you have the <termio.h> header file. */
118 /* #define HAVE_TERMIO_H 1 */
120 /* Define if you have the <termios.h> header file. */
121 /* #define HAVE_TERMIOS_H 1 */
123 /* Define if you have the <time.h> header file. */
124 #define HAVE_TIME_H 1
126 /* Define if you have the <unistd.h> header file. */
127 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
129 #define HAVE_UNISTD_H 1
132 /* Define if you have the <windows.h> header file. */
133 #define HAVE_WINDOWS_H 1
135 /* Define if you have the <winsock.h> header file. */
136 #define HAVE_WINSOCK_H 1
138 /* Define if you have the <winsock2.h> header file. */
140 #define HAVE_WINSOCK2_H 1
143 /* Define if you have the <ws2tcpip.h> header file. */
145 #define HAVE_WS2TCPIP_H 1
148 /* ---------------------------------------------------------------- */
149 /* OTHER HEADER INFO */
150 /* ---------------------------------------------------------------- */
152 /* Define if sig_atomic_t is an available typedef. */
153 #define HAVE_SIG_ATOMIC_T 1
155 /* Define if you have the ANSI C header files. */
156 #define STDC_HEADERS 1
158 /* Define if you can safely include both <sys/time.h> and <time.h>. */
159 /* #define TIME_WITH_SYS_TIME 1 */
161 /* ---------------------------------------------------------------- */
163 /* ---------------------------------------------------------------- */
165 /* Define if you have the closesocket function. */
166 #define HAVE_CLOSESOCKET 1
168 /* Define if you don't have vprintf but do have _doprnt. */
169 /* #define HAVE_DOPRNT 1 */
171 /* Define if you have the ftruncate function. */
172 #define HAVE_FTRUNCATE 1
174 /* Define if you have the gethostbyaddr function. */
175 #define HAVE_GETHOSTBYADDR 1
177 /* Define if you have the gethostname function. */
178 #define HAVE_GETHOSTNAME 1
180 /* Define if you have the getpass function. */
181 /* #define HAVE_GETPASS 1 */
183 /* Define if you have the getservbyname function. */
184 #define HAVE_GETSERVBYNAME 1
186 /* Define if you have the getprotobyname function. */
187 #define HAVE_GETPROTOBYNAME
189 /* Define if you have the gettimeofday function. */
190 /* #define HAVE_GETTIMEOFDAY 1 */
192 /* Define if you have the inet_addr function. */
193 #define HAVE_INET_ADDR 1
195 /* Define if you have the ioctlsocket function. */
196 #define HAVE_IOCTLSOCKET 1
198 /* Define if you have a working ioctlsocket FIONBIO function. */
199 #define HAVE_IOCTLSOCKET_FIONBIO 1
201 /* Define if you have the perror function. */
202 #define HAVE_PERROR 1
204 /* Define if you have the RAND_screen function when using SSL */
205 #define HAVE_RAND_SCREEN 1
207 /* Define if you have the `RAND_status' function when using SSL. */
208 #define HAVE_RAND_STATUS 1
210 /* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function.
211 This is present in OpenSSL versions after 0.9.6b */
212 #define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1
214 /* Define if you have the select function. */
215 #define HAVE_SELECT 1
217 /* Define if you have the setlocale function. */
218 #define HAVE_SETLOCALE 1
220 /* Define if you have the setmode function. */
221 #define HAVE_SETMODE 1
223 /* Define if you have the setvbuf function. */
224 #define HAVE_SETVBUF 1
226 /* Define if you have the socket function. */
227 #define HAVE_SOCKET 1
229 /* Define if you have the strcasecmp function. */
230 /* #define HAVE_STRCASECMP 1 */
232 /* Define if you have the strdup function. */
233 #define HAVE_STRDUP 1
235 /* Define if you have the strftime function. */
236 #define HAVE_STRFTIME 1
238 /* Define if you have the stricmp function. */
239 #define HAVE_STRICMP 1
241 /* Define if you have the strncasecmp function. */
242 /* #define HAVE_STRNCASECMP 1 */
244 /* Define if you have the strnicmp function. */
245 #define HAVE_STRNICMP 1
247 /* Define if you have the strstr function. */
248 #define HAVE_STRSTR 1
250 /* Define if you have the strtoll function. */
251 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__POCC__)
252 #define HAVE_STRTOLL 1
255 /* Define if you have the tcgetattr function. */
256 /* #define HAVE_TCGETATTR 1 */
258 /* Define if you have the tcsetattr function. */
259 /* #define HAVE_TCSETATTR 1 */
261 /* Define if you have the utime function */
266 /* Define to the type qualifier of arg 1 for getnameinfo. */
267 #define GETNAMEINFO_QUAL_ARG1 const
269 /* Define to the type of arg 1 for getnameinfo. */
270 #define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
272 /* Define to the type of arg 2 for getnameinfo. */
273 #define GETNAMEINFO_TYPE_ARG2 socklen_t
275 /* Define to the type of args 4 and 6 for getnameinfo. */
276 #define GETNAMEINFO_TYPE_ARG46 DWORD
278 /* Define to the type of arg 7 for getnameinfo. */
279 #define GETNAMEINFO_TYPE_ARG7 int
281 /* Define if you have the recv function. */
284 /* Define to the type of arg 1 for recv. */
285 #define RECV_TYPE_ARG1 SOCKET
287 /* Define to the type of arg 2 for recv. */
288 #define RECV_TYPE_ARG2 char *
290 /* Define to the type of arg 3 for recv. */
291 #define RECV_TYPE_ARG3 int
293 /* Define to the type of arg 4 for recv. */
294 #define RECV_TYPE_ARG4 int
296 /* Define to the function return type for recv. */
297 #define RECV_TYPE_RETV int
299 /* Define if you have the recvfrom function. */
300 #define HAVE_RECVFROM 1
302 /* Define to the type of arg 1 for recvfrom. */
303 #define RECVFROM_TYPE_ARG1 SOCKET
305 /* Define to the type pointed by arg 2 for recvfrom. */
306 #define RECVFROM_TYPE_ARG2 char
308 /* Define to the type of arg 3 for recvfrom. */
309 #define RECVFROM_TYPE_ARG3 int
311 /* Define to the type of arg 4 for recvfrom. */
312 #define RECVFROM_TYPE_ARG4 int
314 /* Define to the type pointed by arg 5 for recvfrom. */
315 #define RECVFROM_TYPE_ARG5 struct sockaddr
317 /* Define to the type pointed by arg 6 for recvfrom. */
318 #define RECVFROM_TYPE_ARG6 int
320 /* Define to the function return type for recvfrom. */
321 #define RECVFROM_TYPE_RETV int
323 /* Define if you have the send function. */
326 /* Define to the type of arg 1 for send. */
327 #define SEND_TYPE_ARG1 SOCKET
329 /* Define to the type qualifier of arg 2 for send. */
330 #define SEND_QUAL_ARG2 const
332 /* Define to the type of arg 2 for send. */
333 #define SEND_TYPE_ARG2 char *
335 /* Define to the type of arg 3 for send. */
336 #define SEND_TYPE_ARG3 int
338 /* Define to the type of arg 4 for send. */
339 #define SEND_TYPE_ARG4 int
341 /* Define to the function return type for send. */
342 #define SEND_TYPE_RETV int
344 /* ---------------------------------------------------------------- */
345 /* TYPEDEF REPLACEMENTS */
346 /* ---------------------------------------------------------------- */
348 /* Define this if in_addr_t is not an available 'typedefed' type */
349 #define in_addr_t unsigned long
351 /* Define as the return type of signal handlers (int or void). */
352 #define RETSIGTYPE void
354 /* Define ssize_t if it is not an available 'typedefed' type */
355 #ifndef _SSIZE_T_DEFINED
356 # if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
357 defined(__POCC__) || \
359 # elif defined(_WIN64)
360 # define _SSIZE_T_DEFINED
361 # define ssize_t __int64
363 # define _SSIZE_T_DEFINED
368 /* ---------------------------------------------------------------- */
370 /* ---------------------------------------------------------------- */
372 /* The size of `int', as computed by sizeof. */
375 /* The size of `long double', as computed by sizeof. */
376 #define SIZEOF_LONG_DOUBLE 16
378 /* The size of `long long', as computed by sizeof. */
379 /* #define SIZEOF_LONG_LONG 8 */
381 /* The size of `short', as computed by sizeof. */
382 #define SIZEOF_SHORT 2
384 /* The size of `size_t', as computed by sizeof. */
386 # define SIZEOF_SIZE_T 8
388 # define SIZEOF_SIZE_T 4
391 /* ---------------------------------------------------------------- */
393 /* ---------------------------------------------------------------- */
395 /* Define this if you have struct sockaddr_storage */
396 #if !defined(__SALFORDC__) && !defined(__BORLANDC__)
397 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
400 /* Define this if you have struct timeval */
401 #define HAVE_STRUCT_TIMEVAL 1
403 /* Define this if struct sockaddr_in6 has the sin6_scope_id member */
404 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
406 /* ---------------------------------------------------------------- */
407 /* BSD-style lwIP TCP/IP stack SPECIFIC */
408 /* ---------------------------------------------------------------- */
410 /* Define this to use BSD-style lwIP TCP/IP stack */
411 /* #define USE_LWIPSOCK 1 */
415 # undef HAVE_WINSOCK_H
416 # undef HAVE_WINSOCK2_H
417 # undef HAVE_WS2TCPIP_H
419 # undef HAVE_GETHOSTNAME
420 # undef HAVE_GETNAMEINFO
421 # undef LWIP_POSIX_SOCKETS_IO_NAMES
422 # undef RECV_TYPE_ARG1
423 # undef RECV_TYPE_ARG3
424 # undef SEND_TYPE_ARG1
425 # undef SEND_TYPE_ARG3
426 # define HAVE_FREEADDRINFO
427 # define HAVE_GETADDRINFO
428 # define HAVE_GETHOSTBYNAME
429 # define HAVE_GETHOSTBYNAME_R
430 # define HAVE_GETHOSTBYNAME_R_6
431 # define LWIP_POSIX_SOCKETS_IO_NAMES 0
432 # define RECV_TYPE_ARG1 int
433 # define RECV_TYPE_ARG3 size_t
434 # define SEND_TYPE_ARG1 int
435 # define SEND_TYPE_ARG3 size_t
438 /* ---------------------------------------------------------------- */
439 /* Watt-32 tcp/ip SPECIFIC */
440 /* ---------------------------------------------------------------- */
447 #undef HAVE_WINSOCK_H
448 #undef HAVE_WINSOCK2_H
449 #undef HAVE_WS2TCPIP_H
450 #define HAVE_GETADDRINFO
451 #define HAVE_GETNAMEINFO
452 #define HAVE_SYS_IOCTL_H
453 #define HAVE_SYS_SOCKET_H
454 #define HAVE_NETINET_IN_H
456 #define HAVE_ARPA_INET_H
457 #define HAVE_FREEADDRINFO
462 /* ---------------------------------------------------------------- */
463 /* COMPILER SPECIFIC */
464 /* ---------------------------------------------------------------- */
466 /* Undef keyword 'const' if it does not work. */
469 /* Windows should not have HAVE_GMTIME_R defined */
470 /* #undef HAVE_GMTIME_R */
472 /* Define if the compiler supports C99 variadic macro style. */
473 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
474 #define HAVE_VARIADIC_MACROS_C99 1
477 /* Define if the compiler supports the 'long long' data type. */
478 #if defined(__MINGW32__) || defined(__WATCOMC__)
479 #define HAVE_LONGLONG 1
482 /* Define to avoid VS2005 complaining about portable C functions */
483 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
484 #define _CRT_SECURE_NO_DEPRECATE 1
485 #define _CRT_NONSTDC_NO_DEPRECATE 1
488 /* VS2005 and later dafault size for time_t is 64-bit, unless */
489 /* _USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */
490 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
491 # ifndef _USE_32BIT_TIME_T
492 # define SIZEOF_TIME_T 8
494 # define SIZEOF_TIME_T 4
498 /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
499 2000 as a supported build target. VS2008 default installations provide an
500 embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
501 valid build target for VS2008. Popular belief is that binaries built using
502 Windows SDK versions 6.X and build targetting Windows 2000 are functional */
503 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
504 # define VS2008_MINIMUM_TARGET 0x0500
507 /* When no build target is specified VS2008 default build target is Windows
508 Vista, which leaves out even Winsows XP. If no build target has been given
509 for VS2008 we will target the minimum Officially supported build target,
510 which happens to be Windows XP. */
511 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
512 # define VS2008_DEFAULT_TARGET 0x0501
515 /* VS2008 default target settings and minimum build target check */
516 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
517 # ifndef _WIN32_WINNT
518 # define _WIN32_WINNT VS2008_DEFAULT_TARGET
521 # define WINVER VS2008_DEFAULT_TARGET
523 # if (WINVER < VS2008_MINIMUM_TARGET) || \
524 # (_WIN32_WINNT < VS2008_MINIMUM_TARGET)
525 # error VS2008 does not support Windows build targets prior to Windows 2000
529 /* When no build target is specified Pelles C 5.00 and later default build
530 target is Windows Vista. We override default target to be Windows 2000. */
531 #if defined(__POCC__) && (__POCC__ >= 500)
532 # ifndef _WIN32_WINNT
533 # define _WIN32_WINNT 0x0500
536 # define WINVER 0x0500
540 /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
541 quite convoluted, compiler dependent and even build target dependent. */
542 #if defined(HAVE_WS2TCPIP_H)
543 # if defined(__POCC__)
544 # define HAVE_FREEADDRINFO 1
545 # define HAVE_GETADDRINFO 1
546 # define HAVE_GETADDRINFO_THREADSAFE 1
547 # define HAVE_GETNAMEINFO 1
548 # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
549 # define HAVE_FREEADDRINFO 1
550 # define HAVE_GETADDRINFO 1
551 # define HAVE_GETADDRINFO_THREADSAFE 1
552 # define HAVE_GETNAMEINFO 1
553 # elif defined(_MSC_VER) && (_MSC_VER >= 1200)
554 # define HAVE_FREEADDRINFO 1
555 # define HAVE_GETADDRINFO 1
556 # define HAVE_GETADDRINFO_THREADSAFE 1
557 # define HAVE_GETNAMEINFO 1
561 #if defined(__POCC__)
563 # error Microsoft extensions /Ze compiler option is required
565 # ifndef __POCC__OLDNAMES
566 # error Compatibility names /Go compiler option is required
570 /* ---------------------------------------------------------------- */
571 /* LARGE FILE SUPPORT */
572 /* ---------------------------------------------------------------- */
574 #if defined(_MSC_VER) && !defined(_WIN32_WCE)
575 # if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
576 # define USE_WIN32_LARGE_FILES
578 # define USE_WIN32_SMALL_FILES
582 #if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
583 # define USE_WIN32_LARGE_FILES
586 #if defined(__WATCOMC__) && !defined(USE_WIN32_LARGE_FILES)
587 # define USE_WIN32_LARGE_FILES
590 #if defined(__POCC__)
591 # undef USE_WIN32_LARGE_FILES
594 #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
595 # define USE_WIN32_SMALL_FILES
598 /* ---------------------------------------------------------------- */
599 /* DNS RESOLVER SPECIALTY */
600 /* ---------------------------------------------------------------- */
603 * Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS
606 /* Define USE_ARES to enable c-ares asynchronous DNS lookups */
607 /* #define USE_ARES 1 */
609 /* Define USE_THREADS_WIN32 to enable threaded asynchronous DNS lookups */
610 #define USE_THREADS_WIN32 1
612 #if defined(USE_ARES) && defined(USE_THREADS_WIN32)
613 # error "Only one DNS lookup specialty may be defined at most"
616 /* ---------------------------------------------------------------- */
618 /* ---------------------------------------------------------------- */
620 #if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK)
622 #define HAVE_LDAP_SSL_H 1
623 #define HAVE_LDAP_URL_PARSE 1
624 #elif defined(CURL_HAS_OPENLDAP_LDAPSDK)
626 #define HAVE_LDAP_URL_PARSE 1
628 #undef HAVE_LDAP_URL_PARSE
629 #define CURL_LDAP_WIN 1
632 #if defined(__WATCOMC__) && defined(CURL_LDAP_WIN)
633 #if __WATCOMC__ < 1280
634 #define WINBERAPI __declspec(cdecl)
635 #define WINLDAPAPI __declspec(cdecl)
639 #if defined(__POCC__) && defined(CURL_LDAP_WIN)
640 # define CURL_DISABLE_LDAP 1
643 /* ---------------------------------------------------------------- */
644 /* ADDITIONAL DEFINITIONS */
645 /* ---------------------------------------------------------------- */
647 /* Define cpu-machine-OS */
649 #if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
650 #define OS "i386-pc-win32"
651 #elif defined(_M_IA64) /* Itanium */
652 #define OS "ia64-pc-win32"
653 #elif defined(_M_X64) /* AMD64/EM64T - Not defined until MSVC 2005 */
654 #define OS "amd64-pc-win32"
656 #define OS "unknown-pc-win32"
659 /* Name of package */
660 #define PACKAGE "curl"
662 /* If you want to build curl with the built-in manual */
665 #if defined(__POCC__) || (USE_IPV6)
666 # define ENABLE_IPV6 1
669 #endif /* HEADER_CURL_CONFIG_WIN32_H */