From 339f7a2f6b7e81023d7247b4d89e0622cf597d98 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 16 Sep 2022 17:28:20 +0300 Subject: [PATCH] SDL_windows.h: guard WIN32_LEAN_AND_MEAN and STRICT macro defines. also define them as 1, instead of empty. Reference issue: https://github.com/libsdl-org/SDL/issues/6239 --- src/core/windows/SDL_windows.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/core/windows/SDL_windows.h b/src/core/windows/SDL_windows.h index 5c1d63430..8b124d797 100644 --- a/src/core/windows/SDL_windows.h +++ b/src/core/windows/SDL_windows.h @@ -25,8 +25,12 @@ #define _INCLUDED_WINDOWS_H #if defined(__WIN32__) -#define WIN32_LEAN_AND_MEAN -#define STRICT +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#ifndef STRICT +#define STRICT 1 +#endif #ifndef UNICODE #define UNICODE 1 #endif @@ -40,9 +44,14 @@ #define _WIN32_WINNT 0x501 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */ #endif #define WINVER _WIN32_WINNT + #elif defined(__WINGDK__) -#define WIN32_LEAN_AND_MEAN -#define STRICT +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#ifndef STRICT +#define STRICT 1 +#endif #ifndef UNICODE #define UNICODE 1 #endif @@ -50,12 +59,13 @@ #undef _WIN32_WINNT #define _WIN32_WINNT 0xA00 #define WINVER _WIN32_WINNT + #elif defined(__XBOXONE__) || defined(__XBOXSERIES__) #ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 #endif #ifndef STRICT -#define STRICT +#define STRICT 1 #endif #ifndef UNICODE #define UNICODE 1