diff --git a/src/vmaware.hpp b/src/vmaware.hpp index cd3f529..f9af293 100644 --- a/src/vmaware.hpp +++ b/src/vmaware.hpp @@ -207,7 +207,7 @@ struct VM { static constexpr const char* JOEBOX = "JoeBox"; // VM scoreboard table specifically for VM::brand() - static std::map scoreboard; + static std::map scoreboard; // check if cpuid is supported [[nodiscard]] static bool check_cpuid(void) { @@ -457,7 +457,7 @@ struct VM { } // memoize the value from VM::detect() in case it's ran again - static std::map> memo; + static std::map> memo; // cpuid check value static bool cpuid_supported; @@ -2430,8 +2430,7 @@ struct VM { // threshold score const bool result = (points >= 100); - std::string current_brand = ""; - //const char* current_brand = ""; + const char* current_brand = ""; #ifdef __VMAWARE_DEBUG__ for (const auto p : scoreboard) { @@ -2488,7 +2487,11 @@ struct VM { }; -std::map VM::scoreboard { +// ============= EXTERNAL DEFINITIONS ============= +// These are added here due to warnings related to C++17 inline variables for C++ standards that are under 17. +// It's easier to just group them together rather than having C++17<= preprocessors with inline stuff + +std::map VM::scoreboard { { VM::VMWARE, 0 }, { VM::VBOX, 0 }, { VM::KVM, 0 }, @@ -2513,7 +2516,7 @@ std::map VM::scoreboard { VM::u64 VM::flags = 0; bool VM::cpuid_supported = false; -std::map> VM::memo; +std::map> VM::memo; const std::map VM::table = {