Test for EMPTY and MEMBERS so -Wunused-macros accepts them

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-24 09:38:18 +02:00
parent ce210a3419
commit 98848ba230
+4
View File
@@ -958,6 +958,10 @@ class dispatch_with_user_macros_derived_members : public dispatch_with_user_macr
// NOLINTNEXTLINE(misc-use-internal-linkage)
NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE(dispatch_with_user_macros_derived_members, dispatch_with_user_macros_members, own)
// testing for the macros also keeps -Wunused-macros from rejecting them
#if !defined(EMPTY) || !defined(MEMBERS)
#error "EMPTY and MEMBERS must stay defined for the tests above"
#endif
#undef EMPTY
#undef MEMBERS