]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_setup: include _mingw.h
authorJay Satiro <raysatiro@yahoo.com>
Wed, 22 Jun 2022 07:35:19 +0000 (03:35 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 23 Jun 2022 07:34:51 +0000 (03:34 -0400)
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
lib/curl_setup.h
lib/vtls/schannel.h

index 16cdd241084ed7426134c4c81ebb4340d4cf5049..932515667f9164478697aca1344b678537e0eef8 100644 (file)
 
 /* 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))
index 77500b06ec533475d44a192d5e45c6a3c517c83f..4bc8aea38c2eff3fceefa9db28e9b68e3a0ce550 100644 (file)
 #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"
index 49b78c7525888568e7982e16ac28488e99ded107..0b4c4d934431d0c89fcde953b462bb2a7127baf4 100644 (file)
@@ -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