Derive ABI prefix from NLOHMANN_JSON_VERSION_*
This commit is contained in:
parent
bd39ad6d16
commit
0ac4c8aa9b
@ -1,6 +1,18 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// This file contains all macro definitions affecting the ABI
|
// This file contains all macro definitions affecting or depending on the ABI
|
||||||
|
|
||||||
|
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
||||||
|
#if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
|
||||||
|
#if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 10 || NLOHMANN_JSON_VERSION_PATCH != 5
|
||||||
|
#warning "Already included a different version of the library!"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
|
||||||
|
#define NLOHMANN_JSON_VERSION_MINOR 10 // NOLINT(modernize-macro-to-enum)
|
||||||
|
#define NLOHMANN_JSON_VERSION_PATCH 5 // NOLINT(modernize-macro-to-enum)
|
||||||
|
|
||||||
#ifndef JSON_DIAGNOSTICS
|
#ifndef JSON_DIAGNOSTICS
|
||||||
#define JSON_DIAGNOSTICS 0
|
#define JSON_DIAGNOSTICS 0
|
||||||
@ -22,15 +34,23 @@
|
|||||||
#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 json_v3_10_5
|
#define NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch) \
|
||||||
|
json_v ## major ## _ ## minor ## _ ## patch
|
||||||
|
#define NLOHMANN_JSON_ABI_PREFIX(major, minor, patch) \
|
||||||
|
NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch)
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c) a ## b ## c
|
#define NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c) a ## b ## c
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT(a, b, c) NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c)
|
#define NLOHMANN_JSON_ABI_CONCAT(a, b, c) \
|
||||||
|
NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c)
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_STRING \
|
#define NLOHMANN_JSON_ABI_STRING \
|
||||||
NLOHMANN_JSON_ABI_CONCAT( \
|
NLOHMANN_JSON_ABI_CONCAT( \
|
||||||
NLOHMANN_JSON_ABI_PREFIX, \
|
NLOHMANN_JSON_ABI_PREFIX( \
|
||||||
|
NLOHMANN_JSON_VERSION_MAJOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_MINOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_PATCH), \
|
||||||
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
||||||
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON \
|
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
|
||||||
)
|
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE
|
#ifndef NLOHMANN_JSON_NAMESPACE
|
||||||
#define NLOHMANN_JSON_NAMESPACE nlohmann::NLOHMANN_JSON_ABI_STRING
|
#define NLOHMANN_JSON_NAMESPACE nlohmann::NLOHMANN_JSON_ABI_STRING
|
||||||
|
|||||||
@ -18,18 +18,6 @@
|
|||||||
#ifndef INCLUDE_NLOHMANN_JSON_HPP_
|
#ifndef INCLUDE_NLOHMANN_JSON_HPP_
|
||||||
#define INCLUDE_NLOHMANN_JSON_HPP_
|
#define INCLUDE_NLOHMANN_JSON_HPP_
|
||||||
|
|
||||||
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
|
||||||
#if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
|
|
||||||
#if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 10 || NLOHMANN_JSON_VERSION_PATCH != 5
|
|
||||||
#warning "Already included a different version of the library!"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
|
|
||||||
#define NLOHMANN_JSON_VERSION_MINOR 10 // NOLINT(modernize-macro-to-enum)
|
|
||||||
#define NLOHMANN_JSON_VERSION_PATCH 5 // NOLINT(modernize-macro-to-enum)
|
|
||||||
|
|
||||||
#include <algorithm> // all_of, find, for_each
|
#include <algorithm> // all_of, find, for_each
|
||||||
#include <cstddef> // nullptr_t, ptrdiff_t, size_t
|
#include <cstddef> // nullptr_t, ptrdiff_t, size_t
|
||||||
#include <functional> // hash, less
|
#include <functional> // hash, less
|
||||||
|
|||||||
@ -18,18 +18,6 @@
|
|||||||
#ifndef INCLUDE_NLOHMANN_JSON_HPP_
|
#ifndef INCLUDE_NLOHMANN_JSON_HPP_
|
||||||
#define INCLUDE_NLOHMANN_JSON_HPP_
|
#define INCLUDE_NLOHMANN_JSON_HPP_
|
||||||
|
|
||||||
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
|
||||||
#if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
|
|
||||||
#if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 10 || NLOHMANN_JSON_VERSION_PATCH != 5
|
|
||||||
#warning "Already included a different version of the library!"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
|
|
||||||
#define NLOHMANN_JSON_VERSION_MINOR 10 // NOLINT(modernize-macro-to-enum)
|
|
||||||
#define NLOHMANN_JSON_VERSION_PATCH 5 // NOLINT(modernize-macro-to-enum)
|
|
||||||
|
|
||||||
#include <algorithm> // all_of, find, for_each
|
#include <algorithm> // all_of, find, for_each
|
||||||
#include <cstddef> // nullptr_t, ptrdiff_t, size_t
|
#include <cstddef> // nullptr_t, ptrdiff_t, size_t
|
||||||
#include <functional> // hash, less
|
#include <functional> // hash, less
|
||||||
@ -60,7 +48,19 @@
|
|||||||
// #include <nlohmann/detail/abi_macros.hpp>
|
// #include <nlohmann/detail/abi_macros.hpp>
|
||||||
|
|
||||||
|
|
||||||
// This file contains all macro definitions affecting ABI
|
// This file contains all macro definitions affecting or depending on the ABI
|
||||||
|
|
||||||
|
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
||||||
|
#if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
|
||||||
|
#if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 10 || NLOHMANN_JSON_VERSION_PATCH != 5
|
||||||
|
#warning "Already included a different version of the library!"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
|
||||||
|
#define NLOHMANN_JSON_VERSION_MINOR 10 // NOLINT(modernize-macro-to-enum)
|
||||||
|
#define NLOHMANN_JSON_VERSION_PATCH 5 // NOLINT(modernize-macro-to-enum)
|
||||||
|
|
||||||
#ifndef JSON_DIAGNOSTICS
|
#ifndef JSON_DIAGNOSTICS
|
||||||
#define JSON_DIAGNOSTICS 0
|
#define JSON_DIAGNOSTICS 0
|
||||||
@ -82,15 +82,23 @@
|
|||||||
#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 json_v3_10_5
|
#define NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch) \
|
||||||
|
json_v ## major ## _ ## minor ## _ ## patch
|
||||||
|
#define NLOHMANN_JSON_ABI_PREFIX(major, minor, patch) \
|
||||||
|
NLOHMANN_JSON_ABI_PREFIX_EX(major, minor, patch)
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c) a ## b ## c
|
#define NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c) a ## b ## c
|
||||||
#define NLOHMANN_JSON_ABI_CONCAT(a, b, c) NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c)
|
#define NLOHMANN_JSON_ABI_CONCAT(a, b, c) \
|
||||||
|
NLOHMANN_JSON_ABI_CONCAT_EX(a, b, c)
|
||||||
|
|
||||||
#define NLOHMANN_JSON_ABI_STRING \
|
#define NLOHMANN_JSON_ABI_STRING \
|
||||||
NLOHMANN_JSON_ABI_CONCAT( \
|
NLOHMANN_JSON_ABI_CONCAT( \
|
||||||
NLOHMANN_JSON_ABI_PREFIX, \
|
NLOHMANN_JSON_ABI_PREFIX( \
|
||||||
|
NLOHMANN_JSON_VERSION_MAJOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_MINOR, \
|
||||||
|
NLOHMANN_JSON_VERSION_PATCH), \
|
||||||
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
|
||||||
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON \
|
NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
|
||||||
)
|
|
||||||
|
|
||||||
#ifndef NLOHMANN_JSON_NAMESPACE
|
#ifndef NLOHMANN_JSON_NAMESPACE
|
||||||
#define NLOHMANN_JSON_NAMESPACE nlohmann::NLOHMANN_JSON_ABI_STRING
|
#define NLOHMANN_JSON_NAMESPACE nlohmann::NLOHMANN_JSON_ABI_STRING
|
||||||
@ -224,7 +232,6 @@ namespace detail
|
|||||||
{
|
{
|
||||||
|
|
||||||
// https://en.cppreference.com/w/cpp/experimental/is_detected
|
// https://en.cppreference.com/w/cpp/experimental/is_detected
|
||||||
|
|
||||||
struct nonesuch
|
struct nonesuch
|
||||||
{
|
{
|
||||||
nonesuch() = delete;
|
nonesuch() = delete;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user