morganstanley / binlog

A high performance C++ log library, producing structured binary logs
http://opensource.morganstanley.com/binlog/
Apache License 2.0
608 stars 72 forks source link

Enable MSERIALIZE_MAKE_DERIVED unittests on windows #134

Open erenon opened 3 years ago

erenon commented 3 years ago

The following macro invocations fail on MSVC:

MSERIALIZE_MAKE_DERIVED_STRUCT_TAG(Derived1, (Base2, Base3), d, e)
MSERIALIZE_MAKE_DERIVED_STRUCT_SERIALIZABLE(Derived1, (Base2, Base3), d, e)

They appear in tag.cpp, roundtrip.cpp, visit.cpp.

Error is:

not enough arguments for function-like macro invocation 'MSERIALIZE_FOREACH_3'.

It is suspected that (Base2, Base3) does not expand properly, because of the nonstandard msvc preprocessor. The actual user-facing functionality (BINLOG_ADAPT_DERIVED) works. (MSERIALIZE_EXPAND does the trick there for some reason)

Task: Fix the affected macros on MSVC, remove the #ifndef _WIN32 guards from the files above.