1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-24 02:21:01 +03:00

Report the right __cplusplus value for MSVC in basic_json meta() (#3417)

* Report the right __cplusplus value for MSVC in basic_json meta()

* Run amalgamate
This commit is contained in:
flagarde
2022-04-05 02:45:19 +08:00
committed by GitHub
parent 33b75e513a
commit ab5cecb34f
2 changed files with 8 additions and 2 deletions

View File

@ -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";