From: Jay Satiro Date: Fri, 1 Jul 2022 07:02:20 +0000 (-0400) Subject: easy_lock: fix build for mingw X-Git-Tag: curl-7_85_0~210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bbffb8c285bad68350df12405ef67056e7cbfc47;p=thirdparty%2Fcurl.git easy_lock: fix build for mingw - Define SRWLOCK symbols missing in some mingw environments. Closes https://github.com/curl/curl/pull/8997 --- diff --git a/lib/easy_lock.h b/lib/easy_lock.h index a4db9fe47e..808610f8e5 100644 --- a/lib/easy_lock.h +++ b/lib/easy_lock.h @@ -28,6 +28,19 @@ #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600 +#ifdef __MINGW32__ +#ifndef __MINGW64_VERSION_MAJOR +#if (__MINGW32_MAJOR_VERSION < 5) || \ + (__MINGW32_MAJOR_VERSION == 5 && __MINGW32_MINOR_VERSION == 0) +/* mingw >= 5.0.1 defines SRWLOCK, and slightly different from MS define */ +typedef PVOID SRWLOCK, *PSRWLOCK; +#endif +#endif +#ifndef SRWLOCK_INIT +#define SRWLOCK_INIT NULL +#endif +#endif /* __MINGW32__ */ + #define curl_simple_lock SRWLOCK #define CURL_SIMPLE_LOCK_INIT SRWLOCK_INIT