curl/lib/config-win32.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

513 lines
16 KiB
C
Raw Normal View History

#ifndef HEADER_CURL_CONFIG_WIN32_H
#define HEADER_CURL_CONFIG_WIN32_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
2020-11-04 21:02:01 +08:00
* are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
* SPDX-License-Identifier: curl
*
***************************************************************************/
1999-12-29 22:20:26 +08:00
2005-12-18 05:20:35 +08:00
/* ================================================================ */
/* Hand crafted config file for Windows */
2005-12-18 05:20:35 +08:00
/* ================================================================ */
2005-12-18 05:20:35 +08:00
/* ---------------------------------------------------------------- */
/* HEADER FILES */
/* ---------------------------------------------------------------- */
1999-12-29 22:20:26 +08:00
2011-08-07 01:18:43 +08:00
/* Define if you have the <arpa/inet.h> header file. */
2005-12-18 05:20:35 +08:00
/* #define HAVE_ARPA_INET_H 1 */
1999-12-29 22:20:26 +08:00
2011-08-07 01:18:43 +08:00
/* Define if you have the <fcntl.h> header file. */
2005-12-18 05:20:35 +08:00
#define HAVE_FCNTL_H 1
2001-03-14 16:28:54 +08:00
2011-08-07 01:18:43 +08:00
/* Define if you have the <io.h> header file. */
2005-12-18 05:20:35 +08:00
#define HAVE_IO_H 1
2011-08-07 01:18:43 +08:00
/* Define if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
2011-08-07 01:18:43 +08:00
/* Define if you need <malloc.h> header even with <stdlib.h> header file. */
#define NEED_MALLOC_H 1
2011-08-07 01:18:43 +08:00
/* Define if you have the <netdb.h> header file. */
2005-12-18 05:20:35 +08:00
/* #define HAVE_NETDB_H 1 */
2011-08-07 01:18:43 +08:00
/* Define if you have the <netinet/in.h> header file. */
/* #define HAVE_NETINET_IN_H 1 */
2005-12-18 05:20:35 +08:00
/* Define to 1 if you have the <stdbool.h> header file. */
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
#define HAVE_STDBOOL_H 1
#endif
2011-08-07 01:18:43 +08:00
/* Define if you have the <sys/param.h> header file. */
cmake: pre-fill rest of detection values for Windows The goal of this patch is to avoid unnecessary feature detection work when doing Windows builds with CMake. Do this by pre-filling well-known detection results for Windows and specifically for mingw-w64 and MSVC compilers. Also limit feature checks to platforms where the results are actually used. Drop a few redundant ones. And some tidying up. - pre-fill remaining detection values in Windows CMake builds. Based on actual detection results observed in CI runs, preceding similar work over libssh2 and matching up values with `lib/config-win32.h`. This brings down CMake configuration time from 58 to 14 seconds on the same local machine. On AppVeyor CI this translates to: - 128 seconds -> 50 seconds VS2022 MSVC with OpenSSL (per CMake job): https://ci.appveyor.com/project/curlorg/curl/builds/48208419/job/4gw66ecrjpy7necb#L296 https://ci.appveyor.com/project/curlorg/curl/builds/48217440/job/8m4fwrr2fe249uo8#L186 - 62 seconds -> 16 seconds VS2017 MINGW (per CMake job): https://ci.appveyor.com/project/curlorg/curl/builds/48208419/job/s1y8q5ivlcs7ub29?fullLog=true#L290 https://ci.appveyor.com/project/curlorg/curl/builds/48217440/job/pchpxyjsyc9kl13a?fullLog=true#L194 The formula is about 1-3 seconds delay for each detection. Almost all of these trigger a full compile-link cycle behind the scenes, slow even today, both cross and native, mingw-w64 and apparently MSVC too. Enabling .map files or other custom build features slows it down further. (Similar is expected for autotools configure.) - stop detecting `idn2.h` if idn2 was deselected. autotools does this. - stop detecting `idn2.h` if idn2 was not found. This deviates from autotools. Source code requires both header and lib, so this is still correct, but faster. - limit `ADDRESS_FAMILY` detection to Windows. - normalize `HAVE_WIN32_WINNT` value to lowercase `0x0a12` format. - pre-fill `HAVE_WIN32_WINNT`-dependent detection results. Saving 4 (slow) feature-detections in most builds: `getaddrinfo`, `freeaddrinfo`, `inet_ntop`, `inet_pton` - fix pre-filled `HAVE_SYS_TIME_H`, `HAVE_SYS_PARAM_H`, `HAVE_GETTIMEOFDAY` for mingw-w64. Luckily this do not change build results, as `WIN32` took priority over `HAVE_GETTIMEOFDAY` with the current source code. - limit `HAVE_CLOCK_GETTIME_MONOTONIC_RAW` and `HAVE_CLOCK_GETTIME_MONOTONIC` detections to non-Windows. We're not using these in the source code for Windows. - reduce compiler warning noise in CMake internal logs: - fix to include `winsock2.h` before `windows.h`. Apply it to autotools test snippets too. - delete previous `-D_WINSOCKAPI_=` hack that aimed to fix the above. - cleanup `CMake/CurlTests.c` to emit less warnings. - delete redundant `HAVE_MACRO_SIGSETJMP` feature check. It was the same check as `HAVE_SIGSETJMP`. - delete 'experimental' marking from `CURL_USE_OPENSSL`. - show CMake version via `CMakeLists.txt`. Credit to the `zlib-ng` project for the idea: https://github.com/zlib-ng/zlib-ng/blob/61e181c8ae93dbf56040336179c9954078bd1399/CMakeLists.txt#L7 - make `CMake/CurlTests.c` pass `checksrc`. - `CMake/WindowsCache.cmake` tidy-ups. - replace `WIN32` guard with `_WIN32` in `CMake/CurlTests.c`. Closes #12044
2023-10-06 07:38:59 +08:00
#if defined(__MINGW32__)
#define HAVE_SYS_PARAM_H 1
#endif
2005-12-18 05:20:35 +08:00
2011-08-07 01:18:43 +08:00
/* Define if you have the <sys/select.h> header file. */
2005-12-18 05:20:35 +08:00
/* #define HAVE_SYS_SELECT_H 1 */
2011-08-07 01:18:43 +08:00
/* Define if you have the <sys/socket.h> header file. */
/* #define HAVE_SYS_SOCKET_H 1 */
2005-12-18 05:20:35 +08:00
2011-08-07 01:18:43 +08:00
/* Define if you have the <sys/sockio.h> header file. */
2005-12-18 05:20:35 +08:00
/* #define HAVE_SYS_SOCKIO_H 1 */
2011-08-07 01:18:43 +08:00
/* Define if you have the <sys/stat.h> header file. */
2005-12-18 05:20:35 +08:00
#define HAVE_SYS_STAT_H 1
2011-08-07 01:18:43 +08:00
/* Define if you have the <sys/time.h> header file. */
cmake: pre-fill rest of detection values for Windows The goal of this patch is to avoid unnecessary feature detection work when doing Windows builds with CMake. Do this by pre-filling well-known detection results for Windows and specifically for mingw-w64 and MSVC compilers. Also limit feature checks to platforms where the results are actually used. Drop a few redundant ones. And some tidying up. - pre-fill remaining detection values in Windows CMake builds. Based on actual detection results observed in CI runs, preceding similar work over libssh2 and matching up values with `lib/config-win32.h`. This brings down CMake configuration time from 58 to 14 seconds on the same local machine. On AppVeyor CI this translates to: - 128 seconds -> 50 seconds VS2022 MSVC with OpenSSL (per CMake job): https://ci.appveyor.com/project/curlorg/curl/builds/48208419/job/4gw66ecrjpy7necb#L296 https://ci.appveyor.com/project/curlorg/curl/builds/48217440/job/8m4fwrr2fe249uo8#L186 - 62 seconds -> 16 seconds VS2017 MINGW (per CMake job): https://ci.appveyor.com/project/curlorg/curl/builds/48208419/job/s1y8q5ivlcs7ub29?fullLog=true#L290 https://ci.appveyor.com/project/curlorg/curl/builds/48217440/job/pchpxyjsyc9kl13a?fullLog=true#L194 The formula is about 1-3 seconds delay for each detection. Almost all of these trigger a full compile-link cycle behind the scenes, slow even today, both cross and native, mingw-w64 and apparently MSVC too. Enabling .map files or other custom build features slows it down further. (Similar is expected for autotools configure.) - stop detecting `idn2.h` if idn2 was deselected. autotools does this. - stop detecting `idn2.h` if idn2 was not found. This deviates from autotools. Source code requires both header and lib, so this is still correct, but faster. - limit `ADDRESS_FAMILY` detection to Windows. - normalize `HAVE_WIN32_WINNT` value to lowercase `0x0a12` format. - pre-fill `HAVE_WIN32_WINNT`-dependent detection results. Saving 4 (slow) feature-detections in most builds: `getaddrinfo`, `freeaddrinfo`, `inet_ntop`, `inet_pton` - fix pre-filled `HAVE_SYS_TIME_H`, `HAVE_SYS_PARAM_H`, `HAVE_GETTIMEOFDAY` for mingw-w64. Luckily this do not change build results, as `WIN32` took priority over `HAVE_GETTIMEOFDAY` with the current source code. - limit `HAVE_CLOCK_GETTIME_MONOTONIC_RAW` and `HAVE_CLOCK_GETTIME_MONOTONIC` detections to non-Windows. We're not using these in the source code for Windows. - reduce compiler warning noise in CMake internal logs: - fix to include `winsock2.h` before `windows.h`. Apply it to autotools test snippets too. - delete previous `-D_WINSOCKAPI_=` hack that aimed to fix the above. - cleanup `CMake/CurlTests.c` to emit less warnings. - delete redundant `HAVE_MACRO_SIGSETJMP` feature check. It was the same check as `HAVE_SIGSETJMP`. - delete 'experimental' marking from `CURL_USE_OPENSSL`. - show CMake version via `CMakeLists.txt`. Credit to the `zlib-ng` project for the idea: https://github.com/zlib-ng/zlib-ng/blob/61e181c8ae93dbf56040336179c9954078bd1399/CMakeLists.txt#L7 - make `CMake/CurlTests.c` pass `checksrc`. - `CMake/WindowsCache.cmake` tidy-ups. - replace `WIN32` guard with `_WIN32` in `CMake/CurlTests.c`. Closes #12044
2023-10-06 07:38:59 +08:00
#if defined(__MINGW32__)
#define HAVE_SYS_TIME_H 1
#endif
2011-08-07 01:18:43 +08:00
/* Define if you have the <sys/types.h> header file. */
2005-12-18 05:20:35 +08:00
#define HAVE_SYS_TYPES_H 1
2011-08-07 01:18:43 +08:00
/* Define if you have the <sys/utime.h> header file. */
2005-12-18 05:20:35 +08:00
#define HAVE_SYS_UTIME_H 1
2011-08-07 01:18:43 +08:00
/* Define if you have the <termio.h> header file. */
2005-12-18 05:20:35 +08:00
/* #define HAVE_TERMIO_H 1 */
2011-08-07 01:18:43 +08:00
/* Define if you have the <termios.h> header file. */
2005-12-18 05:20:35 +08:00
/* #define HAVE_TERMIOS_H 1 */
2011-08-07 01:18:43 +08:00
/* Define if you have the <unistd.h> header file. */
#if defined(__MINGW32__)
2005-12-18 05:20:35 +08:00
#define HAVE_UNISTD_H 1
#endif
2004-02-23 19:59:28 +08:00
/* Define to 1 if you have the <libgen.h> header file. */
#if defined(__MINGW32__)
#define HAVE_LIBGEN_H 1
#endif
2005-12-18 05:20:35 +08:00
/* ---------------------------------------------------------------- */
/* OTHER HEADER INFO */
/* ---------------------------------------------------------------- */
2011-08-07 01:18:43 +08:00
/* Define if you have the ANSI C header files. */
1999-12-29 22:20:26 +08:00
#define STDC_HEADERS 1
/* Define to 1 if bool is an available type. */
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
#define HAVE_BOOL_T 1
#endif
2005-12-18 05:20:35 +08:00
/* ---------------------------------------------------------------- */
/* FUNCTIONS */
/* ---------------------------------------------------------------- */
1999-12-29 22:20:26 +08:00
2011-08-07 01:18:43 +08:00
/* Define if you have the closesocket function. */
2005-12-18 05:20:35 +08:00
#define HAVE_CLOSESOCKET 1
1999-12-29 22:20:26 +08:00
2011-08-07 01:18:43 +08:00
/* Define if you have the ftruncate function. */
#if defined(__MINGW32__)
#define HAVE_FTRUNCATE 1
#endif
/* Define to 1 if you have the `getpeername' function. */
#define HAVE_GETPEERNAME 1
/* Define to 1 if you have the getsockname function. */
#define HAVE_GETSOCKNAME 1
2011-08-07 01:18:43 +08:00
/* Define if you have the gethostname function. */
1999-12-29 22:20:26 +08:00
#define HAVE_GETHOSTNAME 1
2011-08-07 01:18:43 +08:00
/* Define if you have the gettimeofday function. */
cmake: pre-fill rest of detection values for Windows The goal of this patch is to avoid unnecessary feature detection work when doing Windows builds with CMake. Do this by pre-filling well-known detection results for Windows and specifically for mingw-w64 and MSVC compilers. Also limit feature checks to platforms where the results are actually used. Drop a few redundant ones. And some tidying up. - pre-fill remaining detection values in Windows CMake builds. Based on actual detection results observed in CI runs, preceding similar work over libssh2 and matching up values with `lib/config-win32.h`. This brings down CMake configuration time from 58 to 14 seconds on the same local machine. On AppVeyor CI this translates to: - 128 seconds -> 50 seconds VS2022 MSVC with OpenSSL (per CMake job): https://ci.appveyor.com/project/curlorg/curl/builds/48208419/job/4gw66ecrjpy7necb#L296 https://ci.appveyor.com/project/curlorg/curl/builds/48217440/job/8m4fwrr2fe249uo8#L186 - 62 seconds -> 16 seconds VS2017 MINGW (per CMake job): https://ci.appveyor.com/project/curlorg/curl/builds/48208419/job/s1y8q5ivlcs7ub29?fullLog=true#L290 https://ci.appveyor.com/project/curlorg/curl/builds/48217440/job/pchpxyjsyc9kl13a?fullLog=true#L194 The formula is about 1-3 seconds delay for each detection. Almost all of these trigger a full compile-link cycle behind the scenes, slow even today, both cross and native, mingw-w64 and apparently MSVC too. Enabling .map files or other custom build features slows it down further. (Similar is expected for autotools configure.) - stop detecting `idn2.h` if idn2 was deselected. autotools does this. - stop detecting `idn2.h` if idn2 was not found. This deviates from autotools. Source code requires both header and lib, so this is still correct, but faster. - limit `ADDRESS_FAMILY` detection to Windows. - normalize `HAVE_WIN32_WINNT` value to lowercase `0x0a12` format. - pre-fill `HAVE_WIN32_WINNT`-dependent detection results. Saving 4 (slow) feature-detections in most builds: `getaddrinfo`, `freeaddrinfo`, `inet_ntop`, `inet_pton` - fix pre-filled `HAVE_SYS_TIME_H`, `HAVE_SYS_PARAM_H`, `HAVE_GETTIMEOFDAY` for mingw-w64. Luckily this do not change build results, as `WIN32` took priority over `HAVE_GETTIMEOFDAY` with the current source code. - limit `HAVE_CLOCK_GETTIME_MONOTONIC_RAW` and `HAVE_CLOCK_GETTIME_MONOTONIC` detections to non-Windows. We're not using these in the source code for Windows. - reduce compiler warning noise in CMake internal logs: - fix to include `winsock2.h` before `windows.h`. Apply it to autotools test snippets too. - delete previous `-D_WINSOCKAPI_=` hack that aimed to fix the above. - cleanup `CMake/CurlTests.c` to emit less warnings. - delete redundant `HAVE_MACRO_SIGSETJMP` feature check. It was the same check as `HAVE_SIGSETJMP`. - delete 'experimental' marking from `CURL_USE_OPENSSL`. - show CMake version via `CMakeLists.txt`. Credit to the `zlib-ng` project for the idea: https://github.com/zlib-ng/zlib-ng/blob/61e181c8ae93dbf56040336179c9954078bd1399/CMakeLists.txt#L7 - make `CMake/CurlTests.c` pass `checksrc`. - `CMake/WindowsCache.cmake` tidy-ups. - replace `WIN32` guard with `_WIN32` in `CMake/CurlTests.c`. Closes #12044
2023-10-06 07:38:59 +08:00
#if defined(__MINGW32__)
#define HAVE_GETTIMEOFDAY 1
#endif
1999-12-29 22:20:26 +08:00
/* Define if you have the ioctlsocket function. */
#define HAVE_IOCTLSOCKET 1
2005-12-18 05:20:35 +08:00
/* Define if you have a working ioctlsocket FIONBIO function. */
#define HAVE_IOCTLSOCKET_FIONBIO 1
2011-08-07 01:18:43 +08:00
/* Define if you have the select function. */
1999-12-29 22:20:26 +08:00
#define HAVE_SELECT 1
2011-08-07 01:18:43 +08:00
/* Define if you have the setlocale function. */
#define HAVE_SETLOCALE 1
/* Define if you have the setmode function. */
#define HAVE_SETMODE 1
2011-08-07 01:18:43 +08:00
/* Define if you have the socket function. */
1999-12-29 22:20:26 +08:00
#define HAVE_SOCKET 1
2011-08-07 01:18:43 +08:00
/* Define if you have the strcasecmp function. */
#if defined(__MINGW32__)
#define HAVE_STRCASECMP 1
#endif
1999-12-29 22:20:26 +08:00
2011-08-07 01:18:43 +08:00
/* Define if you have the strdup function. */
1999-12-29 22:20:26 +08:00
#define HAVE_STRDUP 1
/* Define if you have the stricmp function. */
#define HAVE_STRICMP 1
2011-08-07 01:18:43 +08:00
/* Define if you have the strtoll function. */
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
2004-01-22 22:25:19 +08:00
#define HAVE_STRTOLL 1
#endif
2011-08-07 01:18:43 +08:00
/* Define if you have the utime function. */
#define HAVE_UTIME 1
/* Define if you have the recv function. */
#define HAVE_RECV 1
/* Define to the type of arg 1 for recv. */
#define RECV_TYPE_ARG1 SOCKET
/* Define to the type of arg 2 for recv. */
#define RECV_TYPE_ARG2 char *
/* Define to the type of arg 3 for recv. */
#define RECV_TYPE_ARG3 int
/* Define to the type of arg 4 for recv. */
#define RECV_TYPE_ARG4 int
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define if you have the send function. */
#define HAVE_SEND 1
/* Define to the type of arg 1 for send. */
#define SEND_TYPE_ARG1 SOCKET
/* Define to the type qualifier of arg 2 for send. */
#define SEND_QUAL_ARG2 const
/* Define to the type of arg 2 for send. */
#define SEND_TYPE_ARG2 char *
/* Define to the type of arg 3 for send. */
#define SEND_TYPE_ARG3 int
/* Define to the type of arg 4 for send. */
#define SEND_TYPE_ARG4 int
/* Define to the function return type for send. */
#define SEND_TYPE_RETV int
/* Define to 1 if you have the snprintf function. */
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || defined(__MINGW32__)
#define HAVE_SNPRINTF 1
#endif
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600 /* Vista */
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
#define HAVE_INET_NTOP 1
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
#define HAVE_INET_PTON 1
#endif
/* Define to 1 if you have the `basename' function. */
#if defined(__MINGW32__)
#define HAVE_BASENAME 1
#endif
/* Define to 1 if you have the strtok_r function. */
#if defined(__MINGW32__)
#define HAVE_STRTOK_R 1
#endif
/* Define to 1 if you have the signal function. */
#define HAVE_SIGNAL 1
2005-12-18 05:20:35 +08:00
/* ---------------------------------------------------------------- */
/* TYPEDEF REPLACEMENTS */
/* ---------------------------------------------------------------- */
1999-12-29 22:20:26 +08:00
2011-08-07 01:18:43 +08:00
/* Define if in_addr_t is not an available 'typedefed' type. */
2005-12-18 05:20:35 +08:00
#define in_addr_t unsigned long
1999-12-29 22:20:26 +08:00
2011-08-07 01:18:43 +08:00
/* Define if ssize_t is not an available 'typedefed' type. */
#ifndef _SSIZE_T_DEFINED
# if defined(__MINGW32__)
# elif defined(_WIN64)
# define _SSIZE_T_DEFINED
# define ssize_t __int64
# else
# define _SSIZE_T_DEFINED
# define ssize_t int
# endif
#endif
2005-12-18 05:20:35 +08:00
/* ---------------------------------------------------------------- */
/* TYPE SIZES */
/* ---------------------------------------------------------------- */
2011-08-07 01:18:43 +08:00
/* Define to the size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
2011-08-07 01:18:43 +08:00
/* Define to the size of `long long', as computed by sizeof. */
2005-12-18 05:20:35 +08:00
/* #define SIZEOF_LONG_LONG 8 */
2002-08-20 19:42:35 +08:00
/* Define to the size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4
2011-08-07 01:18:43 +08:00
/* Define to the size of `size_t', as computed by sizeof. */
#if defined(_WIN64)
# define SIZEOF_SIZE_T 8
#else
# define SIZEOF_SIZE_T 4
#endif
2017-08-12 21:54:06 +08:00
/* Define to the size of `curl_off_t', as computed by sizeof. */
#define SIZEOF_CURL_OFF_T 8
2005-12-18 05:20:35 +08:00
/* ---------------------------------------------------------------- */
/* COMPILER SPECIFIC */
/* ---------------------------------------------------------------- */
2001-12-02 20:07:36 +08:00
2011-08-07 01:18:43 +08:00
/* Define to nothing if compiler does not support 'const' qualifier. */
/* #define const */
/* Define to nothing if compiler does not support 'volatile' qualifier. */
/* #define volatile */
2004-03-09 16:35:33 +08:00
/* Windows should not have HAVE_GMTIME_R defined */
/* #undef HAVE_GMTIME_R */
/* Define if the compiler supports the 'long long' data type. */
#if (defined(_MSC_VER) && (_MSC_VER >= 1310)) || defined(__MINGW32__)
#define HAVE_LONGLONG 1
#endif
2011-08-07 01:18:43 +08:00
/* Define to avoid VS2005 complaining about portable C functions. */
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#define _CRT_NONSTDC_NO_DEPRECATE 1
#endif
/* mingw-w64 and visual studio >= 2005 (MSVCR80)
all default to 64-bit time_t unless _USE_32BIT_TIME_T is defined */
#if (defined(_MSC_VER) && (_MSC_VER >= 1400)) || defined(__MINGW32__)
# ifndef _USE_32BIT_TIME_T
# define SIZEOF_TIME_T 8
# else
# define SIZEOF_TIME_T 4
# endif
#endif
/* Define some minimum and default build targets for Visual Studio */
#if defined(_MSC_VER)
/* Officially, Microsoft's Windows SDK versions 6.X does not support Windows
2000 as a supported build target. VS2008 default installations provides
an embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
valid build target for VS2008. Popular belief is that binaries built with
VS2008 using Windows SDK versions v6.X and Windows 2000 as a build target
are functional. */
2011-08-07 01:18:43 +08:00
# define VS2008_MIN_TARGET 0x0500
/* The minimum build target for VS2012 is Vista unless Update 1 is installed
2017-03-26 23:02:22 +08:00
and the v110_xp toolset is chosen. */
# if defined(_USING_V110_SDK71_)
# define VS2012_MIN_TARGET 0x0501
# else
# define VS2012_MIN_TARGET 0x0600
# endif
/* VS2008 default build target is Windows Vista. We override default target
to be Windows XP. */
# define VS2008_DEF_TARGET 0x0501
/* VS2012 default build target is Windows Vista unless Update 1 is installed
2017-03-26 23:02:22 +08:00
and the v110_xp toolset is chosen. */
# if defined(_USING_V110_SDK71_)
# define VS2012_DEF_TARGET 0x0501
# else
# define VS2012_DEF_TARGET 0x0600
# endif
#endif
2011-08-07 01:18:43 +08:00
/* VS2008 default target settings and minimum build target check. */
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER <= 1600)
# ifndef _WIN32_WINNT
2011-08-07 01:18:43 +08:00
# define _WIN32_WINNT VS2008_DEF_TARGET
# endif
# ifndef WINVER
2011-08-07 01:18:43 +08:00
# define WINVER VS2008_DEF_TARGET
# endif
2011-08-07 01:18:43 +08:00
# if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)
# error VS2008 does not support Windows build targets prior to Windows 2000
# endif
#endif
/* VS2012 default target settings and minimum build target check. */
#if defined(_MSC_VER) && (_MSC_VER >= 1700)
# ifndef _WIN32_WINNT
# define _WIN32_WINNT VS2012_DEF_TARGET
# endif
# ifndef WINVER
# define WINVER VS2012_DEF_TARGET
# endif
# if (_WIN32_WINNT < VS2012_MIN_TARGET) || (WINVER < VS2012_MIN_TARGET)
# if defined(_USING_V110_SDK71_)
# error VS2012 does not support Windows build targets prior to Windows XP
# else
# error VS2012 does not support Windows build targets prior to Windows \
Vista
# endif
# endif
#endif
/* Windows XP is required for freeaddrinfo, getaddrinfo */
#define HAVE_FREEADDRINFO 1
#define HAVE_GETADDRINFO 1
#define HAVE_GETADDRINFO_THREADSAFE 1
/* ---------------------------------------------------------------- */
/* STRUCT RELATED */
/* ---------------------------------------------------------------- */
/* Define if you have struct sockaddr_storage. */
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
/* Define if you have struct timeval. */
#define HAVE_STRUCT_TIMEVAL 1
/* Define if struct sockaddr_in6 has the sin6_scope_id member. */
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
/* ---------------------------------------------------------------- */
/* LARGE FILE SUPPORT */
/* ---------------------------------------------------------------- */
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
# define USE_WIN32_LARGE_FILES
# else
# define USE_WIN32_SMALL_FILES
# endif
#endif
#if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
# define USE_WIN32_LARGE_FILES
#endif
#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
# define USE_WIN32_SMALL_FILES
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#if defined(USE_WIN32_LARGE_FILES) && defined(__MINGW32__)
# ifndef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 64
# endif
#endif
#ifdef USE_WIN32_LARGE_FILES
#define HAVE__FSEEKI64
#endif
/* Define to the size of `off_t', as computed by sizeof. */
#if defined(__MINGW32__) && \
defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
# define SIZEOF_OFF_T 8
#else
# define SIZEOF_OFF_T 4
#endif
/* ---------------------------------------------------------------- */
/* DNS RESOLVER SPECIALTY */
/* ---------------------------------------------------------------- */
/*
2011-08-07 01:18:43 +08:00
* Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS.
*/
2011-08-07 01:18:43 +08:00
/* Define to enable c-ares asynchronous DNS lookups. */
/* #define USE_ARES 1 */
2013-04-11 20:05:08 +08:00
/* Default define to enable threaded asynchronous DNS lookups. */
#if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \
!defined(USE_THREADS_WIN32)
# define USE_THREADS_WIN32 1
#endif
#if defined(USE_ARES) && defined(USE_THREADS_WIN32)
# error "Only one DNS lookup specialty may be defined at most"
#endif
2005-12-18 05:20:35 +08:00
/* ---------------------------------------------------------------- */
/* LDAP SUPPORT */
2005-12-18 05:20:35 +08:00
/* ---------------------------------------------------------------- */
#if defined(CURL_HAS_NOVELL_LDAPSDK)
#undef USE_WIN32_LDAP
2007-08-20 20:50:44 +08:00
#define HAVE_LDAP_SSL_H 1
#define HAVE_LDAP_URL_PARSE 1
2007-08-25 01:08:49 +08:00
#elif defined(CURL_HAS_OPENLDAP_LDAPSDK)
#undef USE_WIN32_LDAP
2007-08-25 01:08:49 +08:00
#define HAVE_LDAP_URL_PARSE 1
2007-08-20 20:50:44 +08:00
#else
#undef HAVE_LDAP_URL_PARSE
#define HAVE_LDAP_SSL 1
#define USE_WIN32_LDAP 1
2007-08-20 20:50:44 +08:00
#endif
/* Define to use the Windows crypto library. */
#if !defined(CURL_WINDOWS_APP)
#define USE_WIN32_CRYPTO
#endif
/* Define to use Unix sockets. */
#define USE_UNIX_SOCKETS
2005-12-18 05:20:35 +08:00
/* ---------------------------------------------------------------- */
/* ADDITIONAL DEFINITIONS */
/* ---------------------------------------------------------------- */
2005-12-18 05:20:35 +08:00
/* Define cpu-machine-OS */
Makefile.mk: portable Makefile.m32 Update bare GNU Make `Makefile.m32` to: - Move objects into a subdirectory. - Add support for MS-DOS. Tested with DJGPP. - Add support for Watt-32 (on MS-DOS). - Add support for AmigaOS. - Rename `Makefile.m32` to `Makefile.mk` - Replace `ARCH` with `TRIPLET`. - Build `tool_hugehelp.c` proper (when tools are available). - Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`) - Add support for `ZLIB_LIBS` to override `-lz`. - Omit object files when building examples. - Default `CC` to `gcc` once again, for convenience. (Caveat: compiler name `cc` cannot be set now.) - Set `-DCURL_NO_OLDIES` for examples, like autotools does. - Delete `makefile.dj` files. Notice the configuration details and defaults are not retained with the new method. - Delete `makefile.amiga` files. A successful build needs a few custom options. We're also not retaining all build details from the existing Amiga make files. - Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not Windows/MinGW32-specific anymore. - Add support for new `CFG` options: `-map`, `-debug`, `-trackmem` - Set `-DNDEBUG` by default. - Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this with `config-win32.h`. - Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib` instead of bare `ZLIB_PATH`. Note that existing build configurations for MS-DOS and AmigaOS likely become incompatible with this change. Example AmigaOS configuration: ``` export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos- export CC=gcc export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H' export CFLAGS='-mcrt=clib2' export LDFLAGS="${CFLAGS}" export LIBS='-lnet -lm' make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Example MS-DOS configuration: ``` export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp- export WATT_PATH=/opt/djgpp/net/watt export ZLIB_PATH=/opt/djgpp export OPENSSL_PATH=/opt/djgpp export OPENSSL_LIBS='-lssl -lcrypt' export CFG=-zlib-ssl make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Closes #9764
2022-11-22 16:25:05 +08:00
#ifndef OS
#if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
2005-12-18 05:20:35 +08:00
#define OS "i386-pc-win32"
#elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (MSVC >=2005 or gcc) */
#define OS "x86_64-pc-win32"
#elif defined(_M_IA64) || defined(__ia64__) /* Itanium */
#define OS "ia64-pc-win32"
#elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 (Windows RT) */
#define OS "thumbv7a-pc-win32"
#elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */
#define OS "aarch64-pc-win32"
#else
#define OS "unknown-pc-win32"
#endif
#endif
2004-06-24 21:49:14 +08:00
2005-12-18 05:20:35 +08:00
/* Name of package */
#define PACKAGE "curl"
/* If you want to build curl with the built-in manual */
#define USE_MANUAL 1
#endif /* HEADER_CURL_CONFIG_WIN32_H */