From a817da5215abb323a7b6c7ad734bbbd8c146deee Mon Sep 17 00:00:00 2001 From: jeffro256 Date: Thu, 13 Nov 2025 11:39:24 -0600 Subject: [PATCH] serialization: revert va_args_commaprefix usage --- src/common/va_args.h | 10 ---------- src/serialization/serialization.h | 12 ++++++------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/common/va_args.h b/src/common/va_args.h index 3389b1cb9..65aa4e061 100644 --- a/src/common/va_args.h +++ b/src/common/va_args.h @@ -33,13 +33,3 @@ #define PP_THIRD_ARG(a,b,c,...) c #define VA_OPT_SUPPORTED_I(...) PP_THIRD_ARG(__VA_OPT__(,),true,false,) #define VA_OPT_SUPPORTED VA_OPT_SUPPORTED_I(?) - -// VA_ARGS_COMMAPREFIX(): VA_ARGS_COMMAPREFIX(__VA_ARGS__) expands to __VA_ARGS__ with a comma in -// front if more than one argument, else nothing. -// If __VA_OPT__ supported, use that. Else, use GCC's ,## hack -#if VA_OPT_SUPPORTED -# define VA_ARGS_COMMAPREFIX(...) __VA_OPT__(,) __VA_ARGS__ -#else -# define VA_ARGS_COMMAPREFIX(...) , ## __VA_ARGS__ -#endif - diff --git a/src/serialization/serialization.h b/src/serialization/serialization.h index 7ee92131b..4287bb2ca 100644 --- a/src/serialization/serialization.h +++ b/src/serialization/serialization.h @@ -191,9 +191,9 @@ inline auto do_serialize(Archive &ar, T &v, Args&&... args) * VARINT_FIELD_F(). Otherwise, this macro is similar to * BEGIN_SERIALIZE_OBJECT(), as you should list only field serializations. */ -#define BEGIN_SERIALIZE_OBJECT_FN(stype, ...) \ - template class Archive> \ - bool do_serialize_object(Archive &ar, stype &v VA_ARGS_COMMAPREFIX(__VA_ARGS__)) { +#define BEGIN_SERIALIZE_OBJECT_FN(stype) \ + template class Archive> \ + bool do_serialize_object(Archive &ar, stype &v) { /*! \macro PREPARE_CUSTOM_VECTOR_SERIALIZATION */ @@ -211,10 +211,10 @@ inline auto do_serialize(Archive &ar, T &v, Args&&... args) * * \brief serializes a field \a f tagged \a t */ -#define FIELD_N(t, f, ...) \ +#define FIELD_N(t, f) \ do { \ ar.tag(t); \ - bool r = do_serialize(ar, f VA_ARGS_COMMAPREFIX(__VA_ARGS__)); \ + bool r = do_serialize(ar, f); \ if (!r || !ar.good()) return false; \ } while(0); @@ -233,7 +233,7 @@ inline auto do_serialize(Archive &ar, T &v, Args&&... args) * * \brief tags the field with the variable name and then serializes it (for use in a free function) */ -#define FIELD_F(f, ...) FIELD_N(#f, v.f VA_ARGS_COMMAPREFIX(__VA_ARGS__)) +#define FIELD_F(f) FIELD_N(#f, v.f) /*! \macro FIELDS(f) *