Restructure inline namespace and allow version component to be disabled
This commit is contained in:
parent
231f3108ff
commit
a752d1c35d
@ -42,38 +42,59 @@
|
|||||||
#define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
|
#define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch) \
|
#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
|
||||||
json_v ## major ## _ ## minor ## _ ## patch
|
#define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
|
||||||
#define NLOHMANN_JSON_ABI_PREFIX(major, minor, patch) \
|
#endif
|
||||||
NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch)
|
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c) a ## b ## c
|
// Construct the namespace ABI tags component
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT(a, b, c) \
|
#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b
|
||||||
NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c)
|
#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \
|
||||||
|
NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b)
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_STRING \
|
#define NLOHMANN_JSON_ABI_TAGS \
|
||||||
NLOHMANN_JSON_ABI_CONCAT( \
|
NLOHMANN_JSON_ABI_TAGS_CONCAT( \
|
||||||
NLOHMANN_JSON_ABI_PREFIX( \
|
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
||||||
NLOHMANN_JSON_VERSION_MAJOR, \
|
|
||||||
NLOHMANN_JSON_VERSION_MINOR, \
|
|
||||||
NLOHMANN_JSON_VERSION_PATCH), \
|
|
||||||
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
|
||||||
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
|
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
|
||||||
|
|
||||||
|
// Construct the namespace version component
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \
|
||||||
|
_v ## major ## _ ## minor ## _ ## patch
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch)
|
||||||
|
|
||||||
|
#if NLOHMANN_JSON_NAMESPACE_NO_VERSION
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION
|
||||||
|
#else
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_MINOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_PATCH)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Combine namespace components
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b)
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE
|
#ifndef NLOHMANN_JSON_NAMESPACE
|
||||||
#define NLOHMANN_JSON_NAMESPACE nlohmann::NLOHMANN_JSON_ABI_STRING
|
#define NLOHMANN_JSON_NAMESPACE \
|
||||||
|
nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \
|
||||||
|
NLOHMANN_JSON_ABI_TAGS, \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
|
#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||||
#define NLOHMANN_JSON_NAMESPACE_BEGIN \
|
#define NLOHMANN_JSON_NAMESPACE_BEGIN \
|
||||||
namespace nlohmann \
|
namespace nlohmann \
|
||||||
{ \
|
{ \
|
||||||
inline namespace NLOHMANN_JSON_ABI_STRING \
|
inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \
|
||||||
|
NLOHMANN_JSON_ABI_TAGS, \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION) \
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE_END
|
#ifndef NLOHMANN_JSON_NAMESPACE_END
|
||||||
#define NLOHMANN_JSON_NAMESPACE_END \
|
#define NLOHMANN_JSON_NAMESPACE_END \
|
||||||
} /* namespace (abi_string) */ \
|
} /* namespace (inline namespace) NOLINT(readability/namespace) */ \
|
||||||
} /* namespace nlohmann */
|
} // namespace nlohmann
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -90,40 +90,61 @@
|
|||||||
#define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
|
#define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch) \
|
#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
|
||||||
json_v ## major ## _ ## minor ## _ ## patch
|
#define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
|
||||||
#define NLOHMANN_JSON_ABI_PREFIX(major, minor, patch) \
|
#endif
|
||||||
NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch)
|
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c) a ## b ## c
|
// Construct the namespace ABI tags component
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT(a, b, c) \
|
#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b
|
||||||
NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c)
|
#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \
|
||||||
|
NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b)
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_STRING \
|
#define NLOHMANN_JSON_ABI_TAGS \
|
||||||
NLOHMANN_JSON_ABI_CONCAT( \
|
NLOHMANN_JSON_ABI_TAGS_CONCAT( \
|
||||||
NLOHMANN_JSON_ABI_PREFIX( \
|
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
||||||
NLOHMANN_JSON_VERSION_MAJOR, \
|
|
||||||
NLOHMANN_JSON_VERSION_MINOR, \
|
|
||||||
NLOHMANN_JSON_VERSION_PATCH), \
|
|
||||||
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
|
||||||
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
|
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
|
||||||
|
|
||||||
|
// Construct the namespace version component
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \
|
||||||
|
_v ## major ## _ ## minor ## _ ## patch
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch)
|
||||||
|
|
||||||
|
#if NLOHMANN_JSON_NAMESPACE_NO_VERSION
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION
|
||||||
|
#else
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_MINOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_PATCH)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Combine namespace components
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b)
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE
|
#ifndef NLOHMANN_JSON_NAMESPACE
|
||||||
#define NLOHMANN_JSON_NAMESPACE nlohmann::NLOHMANN_JSON_ABI_STRING
|
#define NLOHMANN_JSON_NAMESPACE \
|
||||||
|
nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \
|
||||||
|
NLOHMANN_JSON_ABI_TAGS, \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
|
#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||||
#define NLOHMANN_JSON_NAMESPACE_BEGIN \
|
#define NLOHMANN_JSON_NAMESPACE_BEGIN \
|
||||||
namespace nlohmann \
|
namespace nlohmann \
|
||||||
{ \
|
{ \
|
||||||
inline namespace NLOHMANN_JSON_ABI_STRING \
|
inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \
|
||||||
|
NLOHMANN_JSON_ABI_TAGS, \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION) \
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE_END
|
#ifndef NLOHMANN_JSON_NAMESPACE_END
|
||||||
#define NLOHMANN_JSON_NAMESPACE_END \
|
#define NLOHMANN_JSON_NAMESPACE_END \
|
||||||
} /* namespace (abi_string) */ \
|
} /* namespace (inline namespace) NOLINT(readability/namespace) */ \
|
||||||
} /* namespace nlohmann */
|
} // namespace nlohmann
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// #include <nlohmann/detail/conversions/from_json.hpp>
|
// #include <nlohmann/detail/conversions/from_json.hpp>
|
||||||
|
|||||||
@ -60,40 +60,61 @@
|
|||||||
#define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
|
#define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch) \
|
#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
|
||||||
json_v ## major ## _ ## minor ## _ ## patch
|
#define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
|
||||||
#define NLOHMANN_JSON_ABI_PREFIX(major, minor, patch) \
|
#endif
|
||||||
NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch)
|
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c) a ## b ## c
|
// Construct the namespace ABI tags component
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT(a, b, c) \
|
#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b
|
||||||
NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c)
|
#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \
|
||||||
|
NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b)
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_STRING \
|
#define NLOHMANN_JSON_ABI_TAGS \
|
||||||
NLOHMANN_JSON_ABI_CONCAT( \
|
NLOHMANN_JSON_ABI_TAGS_CONCAT( \
|
||||||
NLOHMANN_JSON_ABI_PREFIX( \
|
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
||||||
NLOHMANN_JSON_VERSION_MAJOR, \
|
|
||||||
NLOHMANN_JSON_VERSION_MINOR, \
|
|
||||||
NLOHMANN_JSON_VERSION_PATCH), \
|
|
||||||
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
|
||||||
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
|
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
|
||||||
|
|
||||||
|
// Construct the namespace version component
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \
|
||||||
|
_v ## major ## _ ## minor ## _ ## patch
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch)
|
||||||
|
|
||||||
|
#if NLOHMANN_JSON_NAMESPACE_NO_VERSION
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION
|
||||||
|
#else
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_VERSION \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_MINOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_PATCH)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Combine namespace components
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b
|
||||||
|
#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b)
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE
|
#ifndef NLOHMANN_JSON_NAMESPACE
|
||||||
#define NLOHMANN_JSON_NAMESPACE nlohmann::NLOHMANN_JSON_ABI_STRING
|
#define NLOHMANN_JSON_NAMESPACE \
|
||||||
|
nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \
|
||||||
|
NLOHMANN_JSON_ABI_TAGS, \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
|
#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||||
#define NLOHMANN_JSON_NAMESPACE_BEGIN \
|
#define NLOHMANN_JSON_NAMESPACE_BEGIN \
|
||||||
namespace nlohmann \
|
namespace nlohmann \
|
||||||
{ \
|
{ \
|
||||||
inline namespace NLOHMANN_JSON_ABI_STRING \
|
inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \
|
||||||
|
NLOHMANN_JSON_ABI_TAGS, \
|
||||||
|
NLOHMANN_JSON_NAMESPACE_VERSION) \
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE_END
|
#ifndef NLOHMANN_JSON_NAMESPACE_END
|
||||||
#define NLOHMANN_JSON_NAMESPACE_END \
|
#define NLOHMANN_JSON_NAMESPACE_END \
|
||||||
} /* namespace (abi_string) */ \
|
} /* namespace (inline namespace) NOLINT(readability/namespace) */ \
|
||||||
} /* namespace nlohmann */
|
} // namespace nlohmann
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user