Skip to content

Commit 1d84d06

Browse files
committed
serialization: revert va_args_commaprefix usage
1 parent bba6aa5 commit 1d84d06

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/common/va_args.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,3 @@
3333
#define PP_THIRD_ARG(a,b,c,...) c
3434
#define VA_OPT_SUPPORTED_I(...) PP_THIRD_ARG(__VA_OPT__(,),true,false,)
3535
#define VA_OPT_SUPPORTED VA_OPT_SUPPORTED_I(?)
36-
37-
// VA_ARGS_COMMAPREFIX(): VA_ARGS_COMMAPREFIX(__VA_ARGS__) expands to __VA_ARGS__ with a comma in
38-
// front if more than one argument, else nothing.
39-
// If __VA_OPT__ supported, use that. Else, use GCC's ,## hack
40-
#if VA_OPT_SUPPORTED
41-
# define VA_ARGS_COMMAPREFIX(...) __VA_OPT__(,) __VA_ARGS__
42-
#else
43-
# define VA_ARGS_COMMAPREFIX(...) , ## __VA_ARGS__
44-
#endif
45-

src/serialization/serialization.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ inline auto do_serialize(Archive &ar, T &v, Args&&... args)
191191
* VARINT_FIELD_F(). Otherwise, this macro is similar to
192192
* BEGIN_SERIALIZE_OBJECT(), as you should list only field serializations.
193193
*/
194-
#define BEGIN_SERIALIZE_OBJECT_FN(stype, ...) \
195-
template <bool W, template <bool> class Archive> \
196-
bool do_serialize_object(Archive<W> &ar, stype &v VA_ARGS_COMMAPREFIX(__VA_ARGS__)) {
194+
#define BEGIN_SERIALIZE_OBJECT_FN(stype) \
195+
template <bool W, template <bool> class Archive> \
196+
bool do_serialize_object(Archive<W> &ar, stype &v) {
197197

198198
/*! \macro PREPARE_CUSTOM_VECTOR_SERIALIZATION
199199
*/
@@ -214,7 +214,7 @@ inline auto do_serialize(Archive &ar, T &v, Args&&... args)
214214
#define FIELD_N(t, f, ...) \
215215
do { \
216216
ar.tag(t); \
217-
bool r = do_serialize(ar, f VA_ARGS_COMMAPREFIX(__VA_ARGS__)); \
217+
bool r = do_serialize(ar, f); \
218218
if (!r || !ar.good()) return false; \
219219
} while(0);
220220

@@ -233,7 +233,7 @@ inline auto do_serialize(Archive &ar, T &v, Args&&... args)
233233
*
234234
* \brief tags the field with the variable name and then serializes it (for use in a free function)
235235
*/
236-
#define FIELD_F(f, ...) FIELD_N(#f, v.f VA_ARGS_COMMAPREFIX(__VA_ARGS__))
236+
#define FIELD_F(f) FIELD_N(#f, v.f)
237237

238238
/*! \macro FIELDS(f)
239239
*

0 commit comments

Comments
 (0)