1#ifndef __LIB_CONFIG_WIN32_H 2#define __LIB_CONFIG_WIN32_H 3/*************************************************************************** 4 * _ _ ____ _ 5 * Project ___| | | | _ \| | 6 * / __| | | | |_) | | 7 * | (__| |_| | _ <| |___ 8 * \___|\___/|_| \_\_____| 9 * 10 * Copyright (C) 1998 - 2011, 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 http://curl.haxx.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 ***************************************************************************/ 24 25/* ================================================================ */ 26/* lib/config-win32.h - Hand crafted config file for Windows */ 27/* ================================================================ */ 28 29/* ---------------------------------------------------------------- */ 30/* HEADER FILES */ 31/* ---------------------------------------------------------------- */ 32 33/* Define if you have the <arpa/inet.h> header file. */ 34/* #define HAVE_ARPA_INET_H 1 */ 35 36/* Define if you have the <assert.h> header file. */ 37#define HAVE_ASSERT_H 1 38 39/* Define if you have the <crypto.h> header file. */ 40/* #define HAVE_CRYPTO_H 1 */ 41 42/* Define if you have the <err.h> header file. */ 43/* #define HAVE_ERR_H 1 */ 44 45/* Define if you have the <fcntl.h> header file. */ 46#define HAVE_FCNTL_H 1 47 48/* Define if you have the <getopt.h> header file. */ 49/* #define HAVE_GETOPT_H 1 */ 50 51/* Define if you have the <io.h> header file. */ 52#define HAVE_IO_H 1 53 54/* Define if you have the <limits.h> header file. */ 55#define HAVE_LIMITS_H 1 56 57/* Define if you need the malloc.h header file even with stdlib.h */ 58#if !defined(__SALFORDC__) && !defined(__POCC__) 59#define NEED_MALLOC_H 1 60#endif 61 62/* Define if you have the <netdb.h> header file. */ 63/* #define HAVE_NETDB_H 1 */ 64 65/* Define if you have the <netinet/in.h> header file. */ 66/* #define HAVE_NETINET_IN_H 1 */ 67 68/* Define if you have the <process.h> header file. */ 69#ifndef __SALFORDC__ 70#define HAVE_PROCESS_H 1 71#endif 72 73/* Define if you have the <signal.h> header file. */ 74#define HAVE_SIGNAL_H 1 75 76/* Define if you have the <sgtty.h> header file. */ 77/* #define HAVE_SGTTY_H 1 */ 78 79/* Define if you have the <ssl.h> header file. */ 80/* #define HAVE_SSL_H 1 */ 81 82/* Define if you have the <stdlib.h> header file. */ 83#define HAVE_STDLIB_H 1 84 85/* Define if you have the <sys/param.h> header file. */ 86/* #define HAVE_SYS_PARAM_H 1 */ 87 88/* Define if you have the <sys/select.h> header file. */ 89/* #define HAVE_SYS_SELECT_H 1 */ 90 91/* Define if you have the <sys/socket.h> header file. */ 92/* #define HAVE_SYS_SOCKET_H 1 */ 93 94/* Define if you have the <sys/sockio.h> header file. */ 95/* #define HAVE_SYS_SOCKIO_H 1 */ 96 97/* Define if you have the <sys/stat.h> header file. */ 98#define HAVE_SYS_STAT_H 1 99 100/* Define if you have the <sys/time.h> header file */ 101/* #define HAVE_SYS_TIME_H 1 */ 102 103/* Define if you have the <sys/types.h> header file. */ 104#define HAVE_SYS_TYPES_H 1 105 106/* Define if you have the <sys/utime.h> header file. */ 107#ifndef __BORLANDC__ 108#define HAVE_SYS_UTIME_H 1 109#endif 110 111/* Define if you have the <termio.h> header file. */ 112/* #define HAVE_TERMIO_H 1 */ 113 114/* Define if you have the <termios.h> header file. */ 115/* #define HAVE_TERMIOS_H 1 */ 116 117/* Define if you have the <time.h> header file. */ 118#define HAVE_TIME_H 1 119 120/* Define if you have the <unistd.h> header file. */ 121#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \ 122 defined(__POCC__) 123#define HAVE_UNISTD_H 1 124#endif 125 126/* Define if you have the <windows.h> header file. */ 127#define HAVE_WINDOWS_H 1 128 129/* Define if you have the <winsock.h> header file. */ 130#define HAVE_WINSOCK_H 1 131 132/* Define if you have the <winsock2.h> header file. */ 133#ifndef __SALFORDC__ 134#define HAVE_WINSOCK2_H 1 135#endif 136 137/* Define if you have the <ws2tcpip.h> header file. */ 138#ifndef __SALFORDC__ 139#define HAVE_WS2TCPIP_H 1 140#endif 141 142/* ---------------------------------------------------------------- */ 143/* OTHER HEADER INFO */ 144/* ---------------------------------------------------------------- */ 145 146/* Define if sig_atomic_t is an available typedef. */ 147#define HAVE_SIG_ATOMIC_T 1 148 149/* Define if you have the ANSI C header files. */ 150#define STDC_HEADERS 1 151 152/* Define if you can safely include both <sys/time.h> and <time.h>. */ 153/* #define TIME_WITH_SYS_TIME 1 */ 154 155/* ---------------------------------------------------------------- */ 156/* FUNCTIONS */ 157/* ---------------------------------------------------------------- */ 158 159/* Define if you have the closesocket function. */ 160#define HAVE_CLOSESOCKET 1 161 162/* Define if you don't have vprintf but do have _doprnt. */ 163/* #define HAVE_DOPRNT 1 */ 164 165/* Define if you have the gethostbyaddr function. */ 166#define HAVE_GETHOSTBYADDR 1 167 168/* Define if you have the gethostname function. */ 169#define HAVE_GETHOSTNAME 1 170 171/* Define if you have the getpass function. */ 172/* #define HAVE_GETPASS 1 */ 173 174/* Define if you have the getservbyname function. */ 175#define HAVE_GETSERVBYNAME 1 176 177/* Define if you have the getprotobyname function. */ 178#define HAVE_GETPROTOBYNAME 179 180/* Define if you have the gettimeofday function. */ 181/* #define HAVE_GETTIMEOFDAY 1 */ 182 183/* Define if you have the inet_addr function. */ 184#define HAVE_INET_ADDR 1 185 186/* Define if you have the ioctlsocket function. */ 187#define HAVE_IOCTLSOCKET 1 188 189/* Define if you have a working ioctlsocket FIONBIO function. */ 190#define HAVE_IOCTLSOCKET_FIONBIO 1 191 192/* Define if you have the perror function. */ 193#define HAVE_PERROR 1 194 195/* Define if you have the RAND_screen function when using SSL */ 196#define HAVE_RAND_SCREEN 1 197 198/* Define if you have the `RAND_status' function when using SSL. */ 199#define HAVE_RAND_STATUS 1 200 201/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. 202 This is present in OpenSSL versions after 0.9.6b */ 203#define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1 204 205/* Define if you have the select function. */ 206#define HAVE_SELECT 1 207 208/* Define if you have the setvbuf function. */ 209#define HAVE_SETVBUF 1 210 211/* Define if you have the socket function. */ 212#define HAVE_SOCKET 1 213 214/* Define if you have the strcasecmp function. */ 215/* #define HAVE_STRCASECMP 1 */ 216 217/* Define if you have the strdup function. */ 218#define HAVE_STRDUP 1 219 220/* Define if you have the strftime function. */ 221#define HAVE_STRFTIME 1 222 223/* Define if you have the stricmp function. */ 224#define HAVE_STRICMP 1 225 226/* Define if you have the strncasecmp function. */ 227/* #define HAVE_STRNCASECMP 1 */ 228 229/* Define if you have the strnicmp function. */ 230#define HAVE_STRNICMP 1 231 232/* Define if you have the strstr function. */ 233#define HAVE_STRSTR 1 234 235/* Define if you have the strtoll function. */ 236#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__POCC__) 237#define HAVE_STRTOLL 1 238#endif 239 240/* Define if you have the tcgetattr function. */ 241/* #define HAVE_TCGETATTR 1 */ 242 243/* Define if you have the tcsetattr function. */ 244/* #define HAVE_TCSETATTR 1 */ 245 246/* Define if you have the utime function */ 247#ifndef __BORLANDC__ 248#define HAVE_UTIME 1 249#endif 250 251/* Define to the type qualifier of arg 1 for getnameinfo. */ 252#define GETNAMEINFO_QUAL_ARG1 const 253 254/* Define to the type of arg 1 for getnameinfo. */ 255#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * 256 257/* Define to the type of arg 2 for getnameinfo. */ 258#define GETNAMEINFO_TYPE_ARG2 socklen_t 259 260/* Define to the type of args 4 and 6 for getnameinfo. */ 261#define GETNAMEINFO_TYPE_ARG46 DWORD 262 263/* Define to the type of arg 7 for getnameinfo. */ 264#define GETNAMEINFO_TYPE_ARG7 int 265 266/* Define if you have the recv function. */ 267#define HAVE_RECV 1 268 269/* Define to the type of arg 1 for recv. */ 270#define RECV_TYPE_ARG1 SOCKET 271 272/* Define to the type of arg 2 for recv. */ 273#define RECV_TYPE_ARG2 char * 274 275/* Define to the type of arg 3 for recv. */ 276#define RECV_TYPE_ARG3 int 277 278/* Define to the type of arg 4 for recv. */ 279#define RECV_TYPE_ARG4 int 280 281/* Define to the function return type for recv. */ 282#define RECV_TYPE_RETV int 283 284/* Define if you have the recvfrom function. */ 285#define HAVE_RECVFROM 1 286 287/* Define to the type of arg 1 for recvfrom. */ 288#define RECVFROM_TYPE_ARG1 SOCKET 289 290/* Define to the type pointed by arg 2 for recvfrom. */ 291#define RECVFROM_TYPE_ARG2 char 292 293/* Define to the type of arg 3 for recvfrom. */ 294#define RECVFROM_TYPE_ARG3 int 295 296/* Define to the type of arg 4 for recvfrom. */ 297#define RECVFROM_TYPE_ARG4 int 298 299/* Define to the type pointed by arg 5 for recvfrom. */ 300#define RECVFROM_TYPE_ARG5 struct sockaddr 301 302/* Define to the type pointed by arg 6 for recvfrom. */ 303#define RECVFROM_TYPE_ARG6 int 304 305/* Define to the function return type for recvfrom. */ 306#define RECVFROM_TYPE_RETV int 307 308/* Define if you have the send function. */ 309#define HAVE_SEND 1 310 311/* Define to the type of arg 1 for send. */ 312#define SEND_TYPE_ARG1 SOCKET 313 314/* Define to the type qualifier of arg 2 for send. */ 315#define SEND_QUAL_ARG2 const 316 317/* Define to the type of arg 2 for send. */ 318#define SEND_TYPE_ARG2 char * 319 320/* Define to the type of arg 3 for send. */ 321#define SEND_TYPE_ARG3 int 322 323/* Define to the type of arg 4 for send. */ 324#define SEND_TYPE_ARG4 int 325 326/* Define to the function return type for send. */ 327#define SEND_TYPE_RETV int 328 329/* ---------------------------------------------------------------- */ 330/* TYPEDEF REPLACEMENTS */ 331/* ---------------------------------------------------------------- */ 332 333/* Define this if in_addr_t is not an available 'typedefed' type */ 334#define in_addr_t unsigned long 335 336/* Define as the return type of signal handlers (int or void). */ 337#define RETSIGTYPE void 338 339/* Define ssize_t if it is not an available 'typedefed' type */ 340#ifndef _SSIZE_T_DEFINED 341# if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \ 342 defined(__POCC__) || \ 343 defined(__MINGW32__) 344# elif defined(_WIN64) 345# define _SSIZE_T_DEFINED 346# define ssize_t __int64 347# else 348# define _SSIZE_T_DEFINED 349# define ssize_t int 350# endif 351#endif 352 353/* ---------------------------------------------------------------- */ 354/* TYPE SIZES */ 355/* ---------------------------------------------------------------- */ 356 357/* The size of `int', as computed by sizeof. */ 358#define SIZEOF_INT 4 359 360/* The size of `long double', as computed by sizeof. */ 361#define SIZEOF_LONG_DOUBLE 16 362 363/* The size of `long long', as computed by sizeof. */ 364/* #define SIZEOF_LONG_LONG 8 */ 365 366/* The size of `short', as computed by sizeof. */ 367#define SIZEOF_SHORT 2 368 369/* The size of `size_t', as computed by sizeof. */ 370#if defined(_WIN64) 371# define SIZEOF_SIZE_T 8 372#else 373# define SIZEOF_SIZE_T 4 374#endif 375 376/* ---------------------------------------------------------------- */ 377/* STRUCT RELATED */ 378/* ---------------------------------------------------------------- */ 379 380/* Define this if you have struct sockaddr_storage */ 381#if !defined(__SALFORDC__) && !defined(__BORLANDC__) 382#define HAVE_STRUCT_SOCKADDR_STORAGE 1 383#endif 384 385/* Define this if you have struct timeval */ 386#define HAVE_STRUCT_TIMEVAL 1 387 388/* ---------------------------------------------------------------- */ 389/* Watt-32 tcp/ip SPECIFIC */ 390/* ---------------------------------------------------------------- */ 391 392#ifdef USE_WATT32 393 #include <tcp.h> 394 #undef byte 395 #undef word 396 #undef USE_WINSOCK 397 #undef HAVE_WINSOCK_H 398 #undef HAVE_WINSOCK2_H 399 #undef HAVE_WS2TCPIP_H 400 #define HAVE_GETADDRINFO 401 #define HAVE_GETNAMEINFO 402 #define HAVE_SYS_IOCTL_H 403 #define HAVE_SYS_SOCKET_H 404 #define HAVE_NETINET_IN_H 405 #define HAVE_NETDB_H 406 #define HAVE_ARPA_INET_H 407 #define HAVE_FREEADDRINFO 408 #define SOCKET int 409#endif 410 411 412/* ---------------------------------------------------------------- */ 413/* COMPILER SPECIFIC */ 414/* ---------------------------------------------------------------- */ 415 416/* Undef keyword 'const' if it does not work. */ 417/* #undef const */ 418 419/* Windows should not have HAVE_GMTIME_R defined */ 420/* #undef HAVE_GMTIME_R */ 421 422/* Define if the compiler supports C99 variadic macro style. */ 423#if defined(_MSC_VER) && (_MSC_VER >= 1400) 424#define HAVE_VARIADIC_MACROS_C99 1 425#endif 426 427/* Define if the compiler supports the 'long long' data type. */ 428#if defined(__MINGW32__) || defined(__WATCOMC__) 429#define HAVE_LONGLONG 1 430#endif 431 432/* Define to avoid VS2005 complaining about portable C functions */ 433#if defined(_MSC_VER) && (_MSC_VER >= 1400) 434#define _CRT_SECURE_NO_DEPRECATE 1 435#define _CRT_NONSTDC_NO_DEPRECATE 1 436#endif 437 438/* VS2005 and later dafault size for time_t is 64-bit, unless */ 439/* _USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */ 440#if defined(_MSC_VER) && (_MSC_VER >= 1400) 441# ifndef _USE_32BIT_TIME_T 442# define SIZEOF_TIME_T 8 443# else 444# define SIZEOF_TIME_T 4 445# endif 446#endif 447 448/* Officially, Microsoft's Windows SDK versions 6.X do not support Windows 449 2000 as a supported build target. VS2008 default installations provide an 450 embedded Windows SDK v6.0A along with the claim that Windows 2000 is a 451 valid build target for VS2008. Popular belief is that binaries built using 452 Windows SDK versions 6.X and Windows 2000 as a build target are functional */ 453#if defined(_MSC_VER) && (_MSC_VER >= 1500) 454# define VS2008_MINIMUM_TARGET 0x0500 455#endif 456 457/* When no build target is specified VS2008 default build target is Windows 458 Vista, which leaves out even Winsows XP. If no build target has been given 459 for VS2008 we will target the minimum Officially supported build target, 460 which happens to be Windows XP. */ 461#if defined(_MSC_VER) && (_MSC_VER >= 1500) 462# define VS2008_DEFAULT_TARGET 0x0501 463#endif 464 465/* VS2008 default target settings and minimum build target check */ 466#if defined(_MSC_VER) && (_MSC_VER >= 1500) 467# ifndef _WIN32_WINNT 468# define _WIN32_WINNT VS2008_DEFAULT_TARGET 469# endif 470# ifndef WINVER 471# define WINVER VS2008_DEFAULT_TARGET 472# endif 473# if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET) 474# error VS2008 does not support Windows build targets prior to Windows 2000 475# endif 476#endif 477 478/* When no build target is specified Pelles C 5.00 and later default build 479 target is Windows Vista. We override default target to be Windows 2000. */ 480#if defined(__POCC__) && (__POCC__ >= 500) 481# ifndef _WIN32_WINNT 482# define _WIN32_WINNT 0x0500 483# endif 484# ifndef WINVER 485# define WINVER 0x0500 486# endif 487#endif 488 489/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is 490 quite convoluted, compiler dependent and even build target dependent. */ 491#if defined(HAVE_WS2TCPIP_H) 492# if defined(__POCC__) 493# define HAVE_FREEADDRINFO 1 494# define HAVE_GETADDRINFO 1 495# define HAVE_GETADDRINFO_THREADSAFE 1 496# define HAVE_GETNAMEINFO 1 497# elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) 498# define HAVE_FREEADDRINFO 1 499# define HAVE_GETADDRINFO 1 500# define HAVE_GETADDRINFO_THREADSAFE 1 501# define HAVE_GETNAMEINFO 1 502# elif defined(_MSC_VER) && (_MSC_VER >= 1200) 503# define HAVE_FREEADDRINFO 1 504# define HAVE_GETADDRINFO 1 505# define HAVE_GETADDRINFO_THREADSAFE 1 506# define HAVE_GETNAMEINFO 1 507# endif 508#endif 509 510#if defined(__POCC__) 511# ifndef _MSC_VER 512# error Microsoft extensions /Ze compiler option is required 513# endif 514# ifndef __POCC__OLDNAMES 515# error Compatibility names /Go compiler option is required 516# endif 517#endif 518 519/* ---------------------------------------------------------------- */ 520/* LARGE FILE SUPPORT */ 521/* ---------------------------------------------------------------- */ 522 523#if defined(_MSC_VER) && !defined(_WIN32_WCE) 524# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) 525# define USE_WIN32_LARGE_FILES 526# else 527# define USE_WIN32_SMALL_FILES 528# endif 529#endif 530 531#if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES) 532# define USE_WIN32_LARGE_FILES 533#endif 534 535#if defined(__WATCOMC__) && !defined(USE_WIN32_LARGE_FILES) 536# define USE_WIN32_LARGE_FILES 537#endif 538 539#if defined(__POCC__) 540# undef USE_WIN32_LARGE_FILES 541#endif 542 543#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES) 544# define USE_WIN32_SMALL_FILES 545#endif 546 547/* ---------------------------------------------------------------- */ 548/* DNS RESOLVER SPECIALTY */ 549/* ---------------------------------------------------------------- */ 550 551/* 552 * Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS 553 */ 554 555/* Define USE_ARES to enable c-ares asynchronous DNS lookups */ 556/* #define USE_ARES 1 */ 557 558/* Define USE_THREADS_WIN32 to enable threaded asynchronous DNS lookups */ 559#define USE_THREADS_WIN32 1 560 561#if defined(USE_ARES) && defined(USE_THREADS_WIN32) 562# error "Only one DNS lookup specialty may be defined at most" 563#endif 564 565/* ---------------------------------------------------------------- */ 566/* LDAP SUPPORT */ 567/* ---------------------------------------------------------------- */ 568 569#if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK) 570#undef CURL_LDAP_WIN 571#define HAVE_LDAP_SSL_H 1 572#define HAVE_LDAP_URL_PARSE 1 573#elif defined(CURL_HAS_OPENLDAP_LDAPSDK) 574#undef CURL_LDAP_WIN 575#define HAVE_LDAP_URL_PARSE 1 576#else 577#undef HAVE_LDAP_URL_PARSE 578#define CURL_LDAP_WIN 1 579#endif 580 581#if defined(__WATCOMC__) && defined(CURL_LDAP_WIN) 582#if __WATCOMC__ < 1280 583#define WINBERAPI __declspec(cdecl) 584#define WINLDAPAPI __declspec(cdecl) 585#endif 586#endif 587 588#if defined(__POCC__) && defined(CURL_LDAP_WIN) 589# define CURL_DISABLE_LDAP 1 590#endif 591 592/* ---------------------------------------------------------------- */ 593/* ADDITIONAL DEFINITIONS */ 594/* ---------------------------------------------------------------- */ 595 596/* Define cpu-machine-OS */ 597#undef OS 598#if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */ 599#define OS "i386-pc-win32" 600#elif defined(_M_IA64) /* Itanium */ 601#define OS "ia64-pc-win32" 602#elif defined(_M_X64) /* AMD64/EM64T - Not defined until MSVC 2005 */ 603#define OS "amd64-pc-win32" 604#else 605#define OS "unknown-pc-win32" 606#endif 607 608/* Name of package */ 609#define PACKAGE "curl" 610 611#if defined(__POCC__) || (USE_IPV6) 612# define ENABLE_IPV6 1 613#endif 614 615#endif /* __LIB_CONFIG_WIN32_H */ 616