Add C++ standard library to JSON meta
This commit is contained in:
parent
867621ee5a
commit
77baab32e6
@ -50,7 +50,11 @@
|
|||||||
#ifdef __has_include
|
#ifdef __has_include
|
||||||
#if __has_include(<version>)
|
#if __has_include(<version>)
|
||||||
#include <version>
|
#include <version>
|
||||||
|
#elif __has_include(<ciso646>)
|
||||||
|
#include <ciso646>
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
#include <ciso646>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM)
|
#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM)
|
||||||
|
|||||||
@ -305,6 +305,17 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
result["compiler"]["c++"] = "unknown";
|
result["compiler"]["c++"] = "unknown";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// see https://en.cppreference.com/w/cpp/header/ciso646
|
||||||
|
#ifdef _LIBCPP_VERSION
|
||||||
|
result["compiler"]["libc++"] = {{"family", "LLVM libc++"}, {"version", _LIBCPP_VERSION}};
|
||||||
|
#elif __GLIBCXX__ // Note: only version 6.1 or newer define this in ciso646
|
||||||
|
result["compiler"]["libc++"] = {{"family", "GNU libstdc++"}, {"version", __GLIBCXX__}};
|
||||||
|
#elif _CPPLIB_VER
|
||||||
|
result["compiler"]["libc++"] = {{"family", "Microsoft STL"}, {"version", _CPPLIB_VER}};
|
||||||
|
#else
|
||||||
|
result["compiler"]["libc++"] = {{"family", "unknown"}, {"version", "unknown"}};
|
||||||
|
#endif
|
||||||
|
|
||||||
// NOLINTBEGIN(modernize-use-bool-literals)
|
// NOLINTBEGIN(modernize-use-bool-literals)
|
||||||
|
|
||||||
result["config"]["JSON_DIAGNOSTICS"] =
|
result["config"]["JSON_DIAGNOSTICS"] =
|
||||||
|
|||||||
@ -2379,7 +2379,11 @@ JSON_HEDLEY_DIAGNOSTIC_POP
|
|||||||
#ifdef __has_include
|
#ifdef __has_include
|
||||||
#if __has_include(<version>)
|
#if __has_include(<version>)
|
||||||
#include <version>
|
#include <version>
|
||||||
|
#elif __has_include(<ciso646>)
|
||||||
|
#include <ciso646>
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
#include <ciso646>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM)
|
#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM)
|
||||||
@ -19316,6 +19320,17 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
result["compiler"]["c++"] = "unknown";
|
result["compiler"]["c++"] = "unknown";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// see https://en.cppreference.com/w/cpp/header/ciso646
|
||||||
|
#ifdef _LIBCPP_VERSION
|
||||||
|
result["compiler"]["libc++"] = {{"family", "LLVM libc++"}, {"version", _LIBCPP_VERSION}};
|
||||||
|
#elif __GLIBCXX__ // Note: only version 6.1 or newer define this in ciso646
|
||||||
|
result["compiler"]["libc++"] = {{"family", "GNU libstdc++"}, {"version", __GLIBCXX__}};
|
||||||
|
#elif _CPPLIB_VER
|
||||||
|
result["compiler"]["libc++"] = {{"family", "Microsoft STL"}, {"version", _CPPLIB_VER}};
|
||||||
|
#else
|
||||||
|
result["compiler"]["libc++"] = {{"family", "unknown"}, {"version", "unknown"}};
|
||||||
|
#endif
|
||||||
|
|
||||||
// NOLINTBEGIN(modernize-use-bool-literals)
|
// NOLINTBEGIN(modernize-use-bool-literals)
|
||||||
|
|
||||||
result["config"]["JSON_DIAGNOSTICS"] =
|
result["config"]["JSON_DIAGNOSTICS"] =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user