diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 6bf77d507..7d4b67db4 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -310,7 +310,10 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec result["compiler"] = {{"family", "unknown"}, {"version", "unknown"}}; #endif -#ifdef __cplusplus + +#if defined(_MSVC_LANG) + result["compiler"]["c++"] = std::to_string(_MSVC_LANG); +#elif defined(__cplusplus) result["compiler"]["c++"] = std::to_string(__cplusplus); #else result["compiler"]["c++"] = "unknown";