From 5688fb19e61079f508daa6f4f5d39485213f2211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 9 Mar 2022 18:18:04 +0100 Subject: [PATCH] Win32: Update rationale for reimplementation It is true that plain MinGW lacks this header, but that is not the main reason for reimplementing IsWindowsVersionOrGreater. (cherry picked from commit aa803f7de5cc086b1c335161a50016f23c49882a) --- src/win32_init.c | 3 ++- src/win32_platform.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/win32_init.c b/src/win32_init.c index c1bdd5a9..4923b266 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -509,7 +509,8 @@ void _glfwUpdateKeyNamesWin32(void) } } -// Replacement for IsWindowsVersionOrGreater as MinGW lacks versionhelpers.h +// Replacement for IsWindowsVersionOrGreater, as we cannot rely on the +// application having a correct embedded manifest // BOOL _glfwIsWindowsVersionOrGreaterWin32(WORD major, WORD minor, WORD sp) { diff --git a/src/win32_platform.h b/src/win32_platform.h index 2e947ecf..92d43d07 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -162,7 +162,9 @@ typedef enum #define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((HANDLE) -4) #endif /*DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2*/ -// HACK: Define versionhelpers.h functions manually as MinGW lacks the header +// Replacement for versionhelpers.h macros, as we cannot rely on the +// application having a correct embedded manifest +// #define IsWindowsXPOrGreater() \ _glfwIsWindowsVersionOrGreaterWin32(HIBYTE(_WIN32_WINNT_WINXP), \ LOBYTE(_WIN32_WINNT_WINXP), 0)