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