diff --git a/BUILD.bazel b/BUILD.bazel index 899f9196d..f0223e2a9 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -20,6 +20,7 @@ cc_library( hdrs = [ "include/nlohmann/adl_serializer.hpp", "include/nlohmann/byte_container_with_subtype.hpp", + "include/nlohmann/detail/abi_config.hpp", "include/nlohmann/detail/abi_macros.hpp", "include/nlohmann/detail/bit_ops.hpp", "include/nlohmann/detail/conversions/from_json.hpp", diff --git a/include/nlohmann/detail/abi_config.hpp b/include/nlohmann/detail/abi_config.hpp new file mode 100644 index 000000000..0e99c81ad --- /dev/null +++ b/include/nlohmann/detail/abi_config.hpp @@ -0,0 +1,34 @@ +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2026 Niels Lohmann +// SPDX-License-Identifier: MIT + +#pragma once + +#include + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/*! +@brief the configuration macros that change the library's behavior + +json.hpp undefines these macros at its end (see macro_unscope.hpp), so code +that builds on the library after it (json_view.hpp) reads them here. Like the +macros, they are part of the ABI namespace, so they always match the +basic_json they are used with. +*/ +struct abi_config +{ + /// JSON_STRICT_NUL_HANDLING: a null byte is an error, not the end of input + static constexpr bool strict_nul_handling = JSON_STRICT_NUL_HANDLING != 0; + /// JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + static constexpr bool legacy_discarded_value_comparison = JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON != 0; +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 500fcddf2..9dd25ba40 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -43,6 +43,7 @@ #include #include +#include #include #include #include diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index aa596a644..d1cf50a08 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -7234,6 +7234,43 @@ class byte_container_with_subtype : public BinaryType NLOHMANN_JSON_NAMESPACE_END +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013-2026 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/*! +@brief the configuration macros that change the library's behavior + +json.hpp undefines these macros at its end (see macro_unscope.hpp), so code +that builds on the library after it (json_view.hpp) reads them here. Like the +macros, they are part of the ABI namespace, so they always match the +basic_json they are used with. +*/ +struct abi_config +{ + /// JSON_STRICT_NUL_HANDLING: a null byte is an error, not the end of input + static constexpr bool strict_nul_handling = JSON_STRICT_NUL_HANDLING != 0; + /// JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + static constexpr bool legacy_discarded_value_comparison = JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON != 0; +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + // #include // #include