From fe6f98c31451222d0a3bd9a42b5ba5d673b0798e Mon Sep 17 00:00:00 2001 From: Echo J Date: Mon, 4 Nov 2024 16:02:53 +0200 Subject: [PATCH] Set Windows defines earlier This avoids compile warnings on MinGW GCC (because standard C++ headers eventually import the Windows stuff) --- SilentPatch/Common_ddraw.cpp | 4 ++-- SilentPatch/Desktop.cpp | 6 +++--- SilentPatch/FriendlyMonitorNames.cpp | 4 ++-- SilentPatch/ParseUtils.cpp | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/SilentPatch/Common_ddraw.cpp b/SilentPatch/Common_ddraw.cpp index 07ab3d7..a0880ed 100644 --- a/SilentPatch/Common_ddraw.cpp +++ b/SilentPatch/Common_ddraw.cpp @@ -1,11 +1,11 @@ -#include "Common_ddraw.h" - #define WIN32_LEAN_AND_MEAN #define WINVER 0x0501 #define _WIN32_WINNT 0x0501 #define NOMINMAX +#include "Common_ddraw.h" + #include #include diff --git a/SilentPatch/Desktop.cpp b/SilentPatch/Desktop.cpp index d4a69c0..e769d9d 100644 --- a/SilentPatch/Desktop.cpp +++ b/SilentPatch/Desktop.cpp @@ -1,11 +1,11 @@ -#include "Desktop.h" - #define WIN32_LEAN_AND_MEAN #define WINVER 0x0501 #define _WIN32_WINNT 0x0501 #define NOMINMAX +#include "Desktop.h" + #include std::pair GetDesktopResolution() @@ -21,4 +21,4 @@ std::pair GetDesktopResolution() result.second = displaySettings.dmPelsHeight; } return result; -} \ No newline at end of file +} diff --git a/SilentPatch/FriendlyMonitorNames.cpp b/SilentPatch/FriendlyMonitorNames.cpp index a219e6c..8610e32 100644 --- a/SilentPatch/FriendlyMonitorNames.cpp +++ b/SilentPatch/FriendlyMonitorNames.cpp @@ -1,5 +1,3 @@ -#include "FriendlyMonitorNames.h" - // This API is Win7 only, so make sure we use dynamic imports #define WIN32_LEAN_AND_MEAN @@ -7,6 +5,8 @@ #define WINVER 0x0602 #define _WIN32_WINNT 0x0602 +#include "FriendlyMonitorNames.h" + #include #include diff --git a/SilentPatch/ParseUtils.cpp b/SilentPatch/ParseUtils.cpp index 52f878c..2ec3431 100644 --- a/SilentPatch/ParseUtils.cpp +++ b/SilentPatch/ParseUtils.cpp @@ -1,7 +1,8 @@ -#include "ParseUtils.hpp" - #define WIN32_LEAN_AND_MEAN #define NOMINMAX + +#include "ParseUtils.hpp" + #include static std::string WcharToUTF8(std::wstring_view str)