From 45e9cbcd52fa49b39b25e20cad2e5eb120ab0df6 Mon Sep 17 00:00:00 2001 From: zhenyan121 <3367366583@qq.com> Date: Fri, 17 Jul 2026 14:33:29 +0800 Subject: [PATCH] fix: mscv cpp version show --- include/Cubed/tools/system_info.hpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/Cubed/tools/system_info.hpp b/include/Cubed/tools/system_info.hpp index 3ba44dc..4b9f2fa 100644 --- a/include/Cubed/tools/system_info.hpp +++ b/include/Cubed/tools/system_info.hpp @@ -173,15 +173,25 @@ inline std::string get_compiler_info() { result += std::to_string(__GNUC_PATCHLEVEL__); #elif defined(_MSC_VER) + int major = _MSC_VER / 100; + int minor = _MSC_VER % 100; + result = "MSVC "; - result += std::to_string(_MSC_VER); + result += std::to_string(major); + result += "."; + result += std::to_string(minor); #else result = "Unknown Compiler"; #endif - + constexpr long cpp_version = +#ifdef _MSC_VER + _MSVC_LANG; +#else + __cplusplus; +#endif result += " (C++"; - result += std::to_string(__cplusplus); + result += std::to_string(cpp_version); result += ")"; return result;