UI: Remove legacy nlohmann workaround (Ubuntu 22.04)

This commit is contained in:
derrod
2024-08-18 03:09:36 +02:00
committed by Ryan Foster
parent f96cf354e6
commit b0e1eced04
2 changed files with 0 additions and 64 deletions
-41
View File
@@ -23,47 +23,6 @@
#include <nlohmann/json.hpp>
/* From whatsnew.hpp */
#ifndef NLOHMANN_DEFINE_TYPE_INTRUSIVE
#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \
friend void to_json(nlohmann::json &nlohmann_json_j, \
const Type &nlohmann_json_t) \
{ \
NLOHMANN_JSON_EXPAND( \
NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) \
} \
friend void from_json(const nlohmann::json &nlohmann_json_j, \
Type &nlohmann_json_t) \
{ \
NLOHMANN_JSON_EXPAND( \
NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) \
}
#endif
#ifndef NLOHMANN_JSON_FROM_WITH_DEFAULT
#define NLOHMANN_JSON_FROM_WITH_DEFAULT(v1) \
nlohmann_json_t.v1 = \
nlohmann_json_j.value(#v1, nlohmann_json_default_obj.v1);
#endif
#ifndef NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT
#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Type, ...) \
friend void to_json(nlohmann::json &nlohmann_json_j, \
const Type &nlohmann_json_t) \
{ \
NLOHMANN_JSON_EXPAND( \
NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) \
} \
friend void from_json(const nlohmann::json &nlohmann_json_j, \
Type &nlohmann_json_t) \
{ \
Type nlohmann_json_default_obj; \
NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE( \
NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) \
}
#endif
/*
* Support for (de-)serialising std::optional
* From https://github.com/nlohmann/json/issues/1749#issuecomment-1731266676
-23
View File
@@ -21,29 +21,6 @@
#include <nlohmann/json.hpp>
/* Ubuntu 22.04 be damned. */
#ifndef NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT
#define NLOHMANN_JSON_FROM_WITH_DEFAULT(v1) \
nlohmann_json_t.v1 = \
nlohmann_json_j.value(#v1, nlohmann_json_default_obj.v1);
#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Type, ...) \
friend void to_json(nlohmann::json &nlohmann_json_j, \
const Type &nlohmann_json_t) \
{ \
NLOHMANN_JSON_EXPAND( \
NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) \
} \
friend void from_json(const nlohmann::json &nlohmann_json_j, \
Type &nlohmann_json_t) \
{ \
Type nlohmann_json_default_obj; \
NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE( \
NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) \
}
#endif
/*
* Support for (de-)serialising std::optional
* Adapted from https://github.com/nlohmann/json/issues/1749#issuecomment-1555093802