1 #ifndef __LIB_CONFIG_WIN32_H
2 #define __LIB_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 /* lib/config-win32.h - 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 need the malloc.h header file even with stdlib.h */
61 #if !defined(__SALFORDC__) && !defined(__POCC__)
62 #define NEED_MALLOC_H 1
65 /* Define if you have the <netdb.h> header file. */
66 /* #define HAVE_NETDB_H 1 */
68 /* Define if you have the <netinet/in.h> header file. */
69 /* #define HAVE_NETINET_IN_H 1 */
71 /* Define if you have the <process.h> header file. */
73 #define HAVE_PROCESS_H 1
76 /* Define if you have the <signal.h> header file. */
77 #define HAVE_SIGNAL_H 1
79 /* Define if you have the <sgtty.h> header file. */
80 /* #define HAVE_SGTTY_H 1 */
82 /* Define if you have the <ssl.h> header file. */
83 /* #define HAVE_SSL_H 1 */
85 /* Define if you have the <stdlib.h> header file. */
86 #define HAVE_STDLIB_H 1
88 /* Define if you have the <sys/param.h> header file. */
89 /* #define HAVE_SYS_PARAM_H 1 */
91 /* Define if you have the <sys/select.h> header file. */
92 /* #define HAVE_SYS_SELECT_H 1 */
94 /* Define if you have the <sys/socket.h> header file. */
95 /* #define HAVE_SYS_SOCKET_H 1 */
97 /* Define if you have the <sys/sockio.h> header file. */
98 /* #define HAVE_SYS_SOCKIO_H 1 */
100 /* Define if you have the <sys/stat.h> header file. */
101 #define HAVE_SYS_STAT_H 1
103 /* Define if you have the <sys/time.h> header file */
104 /* #define HAVE_SYS_TIME_H 1 */
106 /* Define if you have the <sys/types.h> header file. */
107 #define HAVE_SYS_TYPES_H 1
109 /* Define if you have the <sys/utime.h> header file. */
111 #define HAVE_SYS_UTIME_H 1
114 /* Define if you have the <termio.h> header file. */
115 /* #define HAVE_TERMIO_H 1 */
117 /* Define if you have the <termios.h> header file. */
118 /* #define HAVE_TERMIOS_H 1 */
120 /* Define if you have the <time.h> header file. */
121 #define HAVE_TIME_H 1
123 /* Define if you have the <unistd.h> header file. */
124 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
126 #define HAVE_UNISTD_H 1
129 /* Define if you have the <windows.h> header file. */
130 #define HAVE_WINDOWS_H 1
132 /* Define if you have the <winsock.h> header file. */
133 #define HAVE_WINSOCK_H 1
135 /* Define if you have the <winsock2.h> header file. */
137 #define HAVE_WINSOCK2_H 1
140 /* Define if you have the <ws2tcpip.h> header file. */
142 #define HAVE_WS2TCPIP_H 1
145 /* ---------------------------------------------------------------- */
146 /* OTHER HEADER INFO */
147 /* ---------------------------------------------------------------- */
149 /* Define if sig_atomic_t is an available typedef. */
150 #define HAVE_SIG_ATOMIC_T 1
152 /* Define if you have the ANSI C header files. */
153 #define STDC_HEADERS 1
155 /* Define if you can safely include both <sys/time.h> and <time.h>. */
156 /* #define TIME_WITH_SYS_TIME 1 */
158 /* ---------------------------------------------------------------- */
160 /* ---------------------------------------------------------------- */
162 /* Define if you have the closesocket function. */
163 #define HAVE_CLOSESOCKET 1
165 /* Define if you don't have vprintf but do have _doprnt. */
166 /* #define HAVE_DOPRNT 1 */
168 /* Define if you have the gethostbyaddr function. */
169 #define HAVE_GETHOSTBYADDR 1
171 /* Define if you have the gethostname function. */
172 #define HAVE_GETHOSTNAME 1
174 /* Define if you have the getpass function. */
175 /* #define HAVE_GETPASS 1 */
177 /* Define if you have the getservbyname function. */
178 #define HAVE_GETSERVBYNAME 1
180 /* Define if you have the getprotobyname function. */
181 #define HAVE_GETPROTOBYNAME
183 /* Define if you have the gettimeofday function. */
184 /* #define HAVE_GETTIMEOFDAY 1 */
186 /* Define if you have the inet_addr function. */
187 #define HAVE_INET_ADDR 1
189 /* Define if you have the ioctlsocket function. */
190 #define HAVE_IOCTLSOCKET 1
192 /* Define if you have a working ioctlsocket FIONBIO function. */
193 #define HAVE_IOCTLSOCKET_FIONBIO 1
195 /* Define if you have the perror function. */
196 #define HAVE_PERROR 1
198 /* Define if you have the RAND_screen function when using SSL */
199 #define HAVE_RAND_SCREEN 1
201 /* Define if you have the `RAND_status' function when using SSL. */
202 #define HAVE_RAND_STATUS 1
204 /* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function.
205 This is present in OpenSSL versions after 0.9.6b */
206 #define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1
208 /* Define if you have the select function. */
209 #define HAVE_SELECT 1
211 /* Define if you have the setvbuf function. */
212 #define HAVE_SETVBUF 1
214 /* Define if you have the socket function. */
215 #define HAVE_SOCKET 1
217 /* Define if you have the strcasecmp function. */
218 /* #define HAVE_STRCASECMP 1 */
220 /* Define if you have the strdup function. */
221 #define HAVE_STRDUP 1
223 /* Define if you have the strftime function. */
224 #define HAVE_STRFTIME 1
226 /* Define if you have the stricmp function. */
227 #define HAVE_STRICMP 1
229 /* Define if you have the strncasecmp function. */
230 /* #define HAVE_STRNCASECMP 1 */
232 /* Define if you have the strnicmp function. */
233 #define HAVE_STRNICMP 1
235 /* Define if you have the strstr function. */
236 #define HAVE_STRSTR 1
238 /* Define if you have the strtoll function. */
239 #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__POCC__)
240 #define HAVE_STRTOLL 1
243 /* Define if you have the tcgetattr function. */
244 /* #define HAVE_TCGETATTR 1 */
246 /* Define if you have the tcsetattr function. */
247 /* #define HAVE_TCSETATTR 1 */
249 /* Define if you have the utime function */
254 /* Define to the type qualifier of arg 1 for getnameinfo. */
255 #define GETNAMEINFO_QUAL_ARG1 const
257 /* Define to the type of arg 1 for getnameinfo. */
258 #define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
260 /* Define to the type of arg 2 for getnameinfo. */
261 #define GETNAMEINFO_TYPE_ARG2 socklen_t
263 /* Define to the type of args 4 and 6 for getnameinfo. */
264 #define GETNAMEINFO_TYPE_ARG46 DWORD
266 /* Define to the type of arg 7 for getnameinfo. */
267 #define GETNAMEINFO_TYPE_ARG7 int
269 /* Define if you have the recv function. */
272 /* Define to the type of arg 1 for recv. */
273 #define RECV_TYPE_ARG1 SOCKET
275 /* Define to the type of arg 2 for recv. */
276 #define RECV_TYPE_ARG2 char *
278 /* Define to the type of arg 3 for recv. */
279 #define RECV_TYPE_ARG3 int
281 /* Define to the type of arg 4 for recv. */
282 #define RECV_TYPE_ARG4 int
284 /* Define to the function return type for recv. */
285 #define RECV_TYPE_RETV int
287 /* Define if you have the recvfrom function. */
288 #define HAVE_RECVFROM 1
290 /* Define to the type of arg 1 for recvfrom. */
291 #define RECVFROM_TYPE_ARG1 SOCKET
293 /* Define to the type pointed by arg 2 for recvfrom. */
294 #define RECVFROM_TYPE_ARG2 char
296 /* Define to the type of arg 3 for recvfrom. */
297 #define RECVFROM_TYPE_ARG3 int
299 /* Define to the type of arg 4 for recvfrom. */
300 #define RECVFROM_TYPE_ARG4 int
302 /* Define to the type pointed by arg 5 for recvfrom. */
303 #define RECVFROM_TYPE_ARG5 struct sockaddr
305 /* Define to the type pointed by arg 6 for recvfrom. */
306 #define RECVFROM_TYPE_ARG6 int
308 /* Define to the function return type for recvfrom. */
309 #define RECVFROM_TYPE_RETV int
311 /* Define if you have the send function. */
314 /* Define to the type of arg 1 for send. */
315 #define SEND_TYPE_ARG1 SOCKET
317 /* Define to the type qualifier of arg 2 for send. */
318 #define SEND_QUAL_ARG2 const
320 /* Define to the type of arg 2 for send. */
321 #define SEND_TYPE_ARG2 char *
323 /* Define to the type of arg 3 for send. */
324 #define SEND_TYPE_ARG3 int
326 /* Define to the type of arg 4 for send. */
327 #define SEND_TYPE_ARG4 int
329 /* Define to the function return type for send. */
330 #define SEND_TYPE_RETV int
332 /* ---------------------------------------------------------------- */
333 /* TYPEDEF REPLACEMENTS */
334 /* ---------------------------------------------------------------- */
336 /* Define this if in_addr_t is not an available 'typedefed' type */
337 #define in_addr_t unsigned long
339 /* Define as the return type of signal handlers (int or void). */
340 #define RETSIGTYPE void
342 /* Define ssize_t if it is not an available 'typedefed' type */
343 #ifndef _SSIZE_T_DEFINED
344 # if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
345 defined(__POCC__) || \
347 # elif defined(_WIN64)
348 # define _SSIZE_T_DEFINED
349 # define ssize_t __int64
351 # define _SSIZE_T_DEFINED
356 /* ---------------------------------------------------------------- */
358 /* ---------------------------------------------------------------- */
360 /* The size of `int', as computed by sizeof. */
363 /* The size of `long double', as computed by sizeof. */
364 #define SIZEOF_LONG_DOUBLE 16
366 /* The size of `long long', as computed by sizeof. */
367 /* #define SIZEOF_LONG_LONG 8 */
369 /* The size of `short', as computed by sizeof. */
370 #define SIZEOF_SHORT 2
372 /* The size of `size_t', as computed by sizeof. */
374 # define SIZEOF_SIZE_T 8
376 # define SIZEOF_SIZE_T 4
379 /* ---------------------------------------------------------------- */
381 /* ---------------------------------------------------------------- */
383 /* Define this if you have struct sockaddr_storage */
384 #if !defined(__SALFORDC__) && !defined(__BORLANDC__)
385 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
388 /* Define this if you have struct timeval */
389 #define HAVE_STRUCT_TIMEVAL 1
391 /* ---------------------------------------------------------------- */
392 /* BSD-style lwIP TCP/IP stack SPECIFIC */
393 /* ---------------------------------------------------------------- */
395 /* Define this to use BSD-style lwIP TCP/IP stack */
396 /* #define USE_LWIPSOCK 1 */
400 # undef HAVE_WINSOCK_H
401 # undef HAVE_WINSOCK2_H
402 # undef HAVE_WS2TCPIP_H
404 # undef HAVE_GETHOSTNAME
405 # undef HAVE_GETNAMEINFO
406 # undef LWIP_POSIX_SOCKETS_IO_NAMES
407 # define HAVE_FREEADDRINFO
408 # define HAVE_GETADDRINFO
409 # define HAVE_GETHOSTBYNAME
410 # define HAVE_GETHOSTBYNAME_R
411 # define HAVE_GETHOSTBYNAME_R_6
412 # define LWIP_POSIX_SOCKETS_IO_NAMES 0
416 /* ---------------------------------------------------------------- */
417 /* Watt-32 tcp/ip SPECIFIC */
418 /* ---------------------------------------------------------------- */
425 #undef HAVE_WINSOCK_H
426 #undef HAVE_WINSOCK2_H
427 #undef HAVE_WS2TCPIP_H
428 #define HAVE_GETADDRINFO
429 #define HAVE_GETNAMEINFO
430 #define HAVE_SYS_IOCTL_H
431 #define HAVE_SYS_SOCKET_H
432 #define HAVE_NETINET_IN_H
434 #define HAVE_ARPA_INET_H
435 #define HAVE_FREEADDRINFO
440 /* ---------------------------------------------------------------- */
441 /* COMPILER SPECIFIC */
442 /* ---------------------------------------------------------------- */
444 /* Undef keyword 'const' if it does not work. */
447 /* Windows should not have HAVE_GMTIME_R defined */
448 /* #undef HAVE_GMTIME_R */
450 /* Define if the compiler supports C99 variadic macro style. */
451 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
452 #define HAVE_VARIADIC_MACROS_C99 1
455 /* Define if the compiler supports the 'long long' data type. */
456 #if defined(__MINGW32__) || defined(__WATCOMC__)
457 #define HAVE_LONGLONG 1
460 /* Define to avoid VS2005 complaining about portable C functions */
461 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
462 #define _CRT_SECURE_NO_DEPRECATE 1
463 #define _CRT_NONSTDC_NO_DEPRECATE 1
466 /* VS2005 and later dafault size for time_t is 64-bit, unless */
467 /* _USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */
468 #if defined(_MSC_VER) && (_MSC_VER >= 1400)
469 # ifndef _USE_32BIT_TIME_T
470 # define SIZEOF_TIME_T 8
472 # define SIZEOF_TIME_T 4
476 /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
477 2000 as a supported build target. VS2008 default installations provide an
478 embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
479 valid build target for VS2008. Popular belief is that binaries built using
480 Windows SDK versions 6.X and Windows 2000 as a build target are functional */
481 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
482 # define VS2008_MINIMUM_TARGET 0x0500
485 /* When no build target is specified VS2008 default build target is Windows
486 Vista, which leaves out even Winsows XP. If no build target has been given
487 for VS2008 we will target the minimum Officially supported build target,
488 which happens to be Windows XP. */
489 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
490 # define VS2008_DEFAULT_TARGET 0x0501
493 /* VS2008 default target settings and minimum build target check */
494 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
495 # ifndef _WIN32_WINNT
496 # define _WIN32_WINNT VS2008_DEFAULT_TARGET
499 # define WINVER VS2008_DEFAULT_TARGET
501 # if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
502 # error VS2008 does not support Windows build targets prior to Windows 2000
506 /* When no build target is specified Pelles C 5.00 and later default build
507 target is Windows Vista. We override default target to be Windows 2000. */
508 #if defined(__POCC__) && (__POCC__ >= 500)
509 # ifndef _WIN32_WINNT
510 # define _WIN32_WINNT 0x0500
513 # define WINVER 0x0500
517 /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
518 quite convoluted, compiler dependent and even build target dependent. */
519 #if defined(HAVE_WS2TCPIP_H)
520 # if defined(__POCC__)
521 # define HAVE_FREEADDRINFO 1
522 # define HAVE_GETADDRINFO 1
523 # define HAVE_GETADDRINFO_THREADSAFE 1
524 # define HAVE_GETNAMEINFO 1
525 # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
526 # define HAVE_FREEADDRINFO 1
527 # define HAVE_GETADDRINFO 1
528 # define HAVE_GETADDRINFO_THREADSAFE 1
529 # define HAVE_GETNAMEINFO 1
530 # elif defined(_MSC_VER) && (_MSC_VER >= 1200)
531 # define HAVE_FREEADDRINFO 1
532 # define HAVE_GETADDRINFO 1
533 # define HAVE_GETADDRINFO_THREADSAFE 1
534 # define HAVE_GETNAMEINFO 1
538 #if defined(__POCC__)
540 # error Microsoft extensions /Ze compiler option is required
542 # ifndef __POCC__OLDNAMES
543 # error Compatibility names /Go compiler option is required
547 /* ---------------------------------------------------------------- */
548 /* LARGE FILE SUPPORT */
549 /* ---------------------------------------------------------------- */
551 #if defined(_MSC_VER) && !defined(_WIN32_WCE)
552 # if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
553 # define USE_WIN32_LARGE_FILES
555 # define USE_WIN32_SMALL_FILES
559 #if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
560 # define USE_WIN32_LARGE_FILES
563 #if defined(__WATCOMC__) && !defined(USE_WIN32_LARGE_FILES)
564 # define USE_WIN32_LARGE_FILES
567 #if defined(__POCC__)
568 # undef USE_WIN32_LARGE_FILES
571 #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
572 # define USE_WIN32_SMALL_FILES
575 /* ---------------------------------------------------------------- */
576 /* DNS RESOLVER SPECIALTY */
577 /* ---------------------------------------------------------------- */
580 * Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS
583 /* Define USE_ARES to enable c-ares asynchronous DNS lookups */
584 /* #define USE_ARES 1 */
586 /* Define USE_THREADS_WIN32 to enable threaded asynchronous DNS lookups */
587 #define USE_THREADS_WIN32 1
589 #if defined(USE_ARES) && defined(USE_THREADS_WIN32)
590 # error "Only one DNS lookup specialty may be defined at most"
593 /* ---------------------------------------------------------------- */
595 /* ---------------------------------------------------------------- */
597 #if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK)
599 #define HAVE_LDAP_SSL_H 1
600 #define HAVE_LDAP_URL_PARSE 1
601 #elif defined(CURL_HAS_OPENLDAP_LDAPSDK)
603 #define HAVE_LDAP_URL_PARSE 1
605 #undef HAVE_LDAP_URL_PARSE
606 #define CURL_LDAP_WIN 1
609 #if defined(__WATCOMC__) && defined(CURL_LDAP_WIN)
610 #if __WATCOMC__ < 1280
611 #define WINBERAPI __declspec(cdecl)
612 #define WINLDAPAPI __declspec(cdecl)
616 #if defined(__POCC__) && defined(CURL_LDAP_WIN)
617 # define CURL_DISABLE_LDAP 1
620 /* ---------------------------------------------------------------- */
621 /* ADDITIONAL DEFINITIONS */
622 /* ---------------------------------------------------------------- */
624 /* Define cpu-machine-OS */
626 #if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
627 #define OS "i386-pc-win32"
628 #elif defined(_M_IA64) /* Itanium */
629 #define OS "ia64-pc-win32"
630 #elif defined(_M_X64) /* AMD64/EM64T - Not defined until MSVC 2005 */
631 #define OS "amd64-pc-win32"
633 #define OS "unknown-pc-win32"
636 /* Name of package */
637 #define PACKAGE "curl"
639 #if defined(__POCC__) || (USE_IPV6)
640 # define ENABLE_IPV6 1
643 #endif /* __LIB_CONFIG_WIN32_H */