From 2bb0602ebba9a077cf2a562413937f9b142c5b5b Mon Sep 17 00:00:00 2001 From: Quantum Date: Mon, 19 Jul 2021 19:55:19 -0400 Subject: [PATCH] [common] windebug: remove custom-rolled Windows 8 detector Just use from Windows SDK. --- common/include/common/windebug.h | 2 -- common/src/platform/windows/windebug.c | 24 ------------------------ 2 files changed, 26 deletions(-) diff --git a/common/include/common/windebug.h b/common/include/common/windebug.h index 8ce40ec8..f7bb3470 100644 --- a/common/include/common/windebug.h +++ b/common/include/common/windebug.h @@ -33,8 +33,6 @@ void DebugWinError(const char * file, const unsigned int line, const char * func #define DEBUG_WINERROR(x, y) DebugWinError(STRIPPATH(__FILE__), __LINE__, __FUNCTION__, x, y) -bool IsWindows8(); - #ifdef __cplusplus } #endif diff --git a/common/src/platform/windows/windebug.c b/common/src/platform/windows/windebug.c index 0c0c5b60..855c6d81 100644 --- a/common/src/platform/windows/windebug.c +++ b/common/src/platform/windows/windebug.c @@ -41,27 +41,3 @@ void DebugWinError(const char * file, const unsigned int line, const char * func fprintf(stderr, "%12" PRId64 " [E] %20s:%-4u | %-30s | %s: 0x%08x (%s)\n", microtime(), file, line, function, desc, (int)status, buffer); LocalFree(buffer); } - -/* credit for this function to: https://stackoverflow.com/questions/17399302/how-can-i-detect-windows-8-1-in-a-desktop-application */ -inline static BOOL CompareWindowsVersion(DWORD dwMajorVersion, DWORD dwMinorVersion) -{ - OSVERSIONINFOEX ver; - DWORDLONG dwlConditionMask = 0; - - ZeroMemory(&ver, sizeof(OSVERSIONINFOEX)); - ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - ver.dwMajorVersion = dwMajorVersion; - ver.dwMinorVersion = dwMinorVersion; - - VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_EQUAL); - - return VerifyVersionInfo(&ver, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask); -} - -bool IsWindows8(void) -{ - return - (CompareWindowsVersion(6, 3) == TRUE) || - (CompareWindowsVersion(6, 2) == TRUE); -}