From ac4df08e6b8ab3b5d8ca9b491e9783d60832e9c5 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Fri, 24 Dec 2021 20:02:34 +0100 Subject: [PATCH] Small improvement in OS detection code. --- src/OSSupport_Win32.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/OSSupport_Win32.cpp b/src/OSSupport_Win32.cpp index 78bdcb3..cf9cee9 100644 --- a/src/OSSupport_Win32.cpp +++ b/src/OSSupport_Win32.cpp @@ -450,14 +450,13 @@ const MUtils::OS::Version::os_version_t &MUtils::OS::os_version(void) const char *MUtils::OS::os_friendly_name(const MUtils::OS::Version::os_version_t &os_version) { const char *friendly_name = NULL; - for(size_t i = 0; g_os_version_lut[i].version.type != MUtils::OS::Version::OS_UNKNOWN; i++) + for (size_t i = 0; g_os_version_lut[i].version.type != MUtils::OS::Version::OS_UNKNOWN; i++) { - if(os_version >= g_os_version_lut[i].version) + const MUtils::OS::Version::os_version_t &version = g_os_version_lut[i].version; + if ((os_version.versionMajor == version.versionMajor) && (os_version.versionMinor == version.versionMinor) && (os_version.versionBuild >= version.versionBuild)) { friendly_name = g_os_version_lut[i].friendlyName; - continue; } - break; } return friendly_name; @@ -1785,7 +1784,7 @@ const QLatin1String &MUtils::OS::null_device(void) // DEBUGGER CHECK /////////////////////////////////////////////////////////////////////////////// -#if (!(MUTILS_DEBUG)) +#if 0//(!(MUTILS_DEBUG)) static __forceinline bool is_debugger_present(void) { __try