From b0e1eced04cf674580f32e3a5452e004b3034da8 Mon Sep 17 00:00:00 2001 From: derrod Date: Sun, 18 Aug 2024 03:09:36 +0200 Subject: [PATCH] UI: Remove legacy nlohmann workaround (Ubuntu 22.04) --- UI/models/multitrack-video.hpp | 41 ---------------------------------- UI/update/models/whatsnew.hpp | 23 ------------------- 2 files changed, 64 deletions(-) diff --git a/UI/models/multitrack-video.hpp b/UI/models/multitrack-video.hpp index 30b2218da..535da6579 100644 --- a/UI/models/multitrack-video.hpp +++ b/UI/models/multitrack-video.hpp @@ -23,47 +23,6 @@ #include -/* 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 diff --git a/UI/update/models/whatsnew.hpp b/UI/update/models/whatsnew.hpp index 59722ebf4..399bfa784 100644 --- a/UI/update/models/whatsnew.hpp +++ b/UI/update/models/whatsnew.hpp @@ -21,29 +21,6 @@ #include -/* 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