Loki-Astari / ThorsMongo

C++ MongoDB API and BSON/JSON Serialization library
GNU General Public License v3.0
316 stars 72 forks source link

Compilation issue with VisualStudio 2019 on Windows #69

Closed DevJoy77 closed 3 years ago

DevJoy77 commented 3 years ago

Hi, I had to modify this macro like this to make it compile

define ThorsAnvil_MakeTrait(DataType, ...) \

ThorsAnvil_MakeTrait_Base( , Map, 00, DataType, __VA_ARGS__, 1);               \
ThorsAnvil_RegisterPolyMorphicType_Internal(DataType, __VA_ARGS__, 1)         \
static_assert(true, "")

Cheers!

Loki-Astari commented 3 years ago

Hi.

Thanks for the update. What was the error message without that change?

Loki-Astari commented 3 years ago

PS. When pasting code use into these text boxes. Add ```` on each side of the code so it is displayed as code and not normall text (as you can see in your initial comment the __ has been removed to generate bold text).

Loki-Astari commented 3 years ago

I tried your change. Unfortunately it causes the UNIT TESTS to fail.

Specifically: line 66: src/Serialize/test/BinaryParserTest.h

ThorsAnvil_MakeTrait(BinaryParserTest::MapEmptyTest);

Note in this test we make sure that we can have a type without any values. In your macro:

        DataType    => BinaryParserTest::MapEmptyTest
        __VA_ARGS__ => /*Empty Set */

Unfortunately the ... (or __VA_ARGS__) is not allowed to map to zero parameters.

Loki-Astari commented 3 years ago

Closing as can not reproduce the issue.

I am willing to work on the issue to make it work on Windows with your help. But I need more details about the errors. Please re-open if you want to help solve the issue.