From 37337175098a324f3ffb9f158fbac6ae84bb204f Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Wed, 22 Jun 2022 03:35:19 -0400 Subject: curl_setup: include _mingw.h Prior to this change _mingw.h needed to be included in each unit before evaluating __MINGW{32,64}_xxx_VERSION macros since it defines them. It is included only in some mingw headers (eg stdio.h) and not others (eg windows.h) so it's better to explicitly include it once. Closes https://github.com/curl/curl/pull/9036 --- lib/config-win32.h | 3 --- lib/curl_setup.h | 5 +++++ lib/vtls/schannel.h | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/config-win32.h b/lib/config-win32.h index 16cdd2410..932515667 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -453,9 +453,6 @@ /* mingw-w64, mingw using >= MSVCR80, and visual studio >= 2005 (MSVCR80) all default to 64-bit time_t unless _USE_32BIT_TIME_T is defined */ -#ifdef __MINGW32__ -# include <_mingw.h> -#endif #if defined(__MINGW64_VERSION_MAJOR) || \ (defined(__MINGW32__) && (__MSVCRT_VERSION__ >= 0x0800)) || \ (defined(_MSC_VER) && (_MSC_VER >= 1400)) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 77500b06e..4bc8aea38 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -28,6 +28,11 @@ #define CURL_NO_OLDIES #endif +/* define mingw version macros, eg __MINGW{32,64}_{MINOR,MAJOR}_VERSION */ +#ifdef __MINGW32__ +#include <_mingw.h> +#endif + /* * Disable Visual Studio warnings: * 4127 "conditional expression is constant" diff --git a/lib/vtls/schannel.h b/lib/vtls/schannel.h index 49b78c752..0b4c4d934 100644 --- a/lib/vtls/schannel.h +++ b/lib/vtls/schannel.h @@ -62,7 +62,6 @@ CURLcode Curl_verify_certificate(struct Curl_easy *data, #ifdef EXPOSE_SCHANNEL_INTERNAL_STRUCTS #ifdef __MINGW32__ -#include <_mingw.h> #ifdef __MINGW64_VERSION_MAJOR #define HAS_MANUAL_VERIFY_API #endif -- cgit v1.2.1