From b75b5eaf6dc1186d7db6263471355a93a2b8bd81 Mon Sep 17 00:00:00 2001 From: Existential-Kernel Date: Tue, 24 Oct 2023 07:47:45 +0100 Subject: [PATCH] msvc fix attempt 1 --- src/vmaware.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/vmaware.hpp b/src/vmaware.hpp index 150b4c1..50ab564 100644 --- a/src/vmaware.hpp +++ b/src/vmaware.hpp @@ -487,9 +487,7 @@ struct VM { * return false; * } */ - #if (MSVC) - __declspec(noalias) __declspec(restrict) - #elif (LINUX) + #if (LINUX && __has_cpp_attribute(gnu::pure)) [[gnu::pure]] #endif [[nodiscard]] static inline bool disabled(const u64 p_flag) noexcept { @@ -1897,10 +1895,10 @@ struct VM { return false; } - HKEY hKey = 0; + HKEY hKey; char buf[0xFF] = {0}; DWORD dwBufSize = sizeof(buf); - const bool result = (RegOpenKeyEx(TEXT("SOFTWARE\\VMware, Inc.\\VMware Tools"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS); + bool result = (RegOpenKeyEx("SOFTWARE\\VMware, Inc.\\VMware Tools"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS); #ifdef __VMAWARE_DEBUG__ debug("VMWARE_REG: result = ", result);