banditcpp/bandit

Does not build under MSVC

Closed this issue · 2 comments

A similar issue to snowhouse's noexcept use happens in the matcherexception.h file in bandit preventing the code to build under MSVC.

@kawazoe Could you please check if my changes work? I don't have access to Visual Studio at the moment.

I initially thought it would be sufficient, but there are still two MSVC-only warnings that can be fixed.

First, based on this visual studio issue, it appears that the noexcept keyword is part of the compiler's keyword-macro redefinition checklist; even though it does not supports the keyword yet. I would recommend using the workaround provided in the link inside the code that you just added to prevent this warning:

// Visual Studio (including 2013) does not support the noexcept keyword
#define _ALLOW_KEYWORD_MACROS
#define noexcept

Second, unfortunately, MSVC throws a warning on #pragma mark. You can use the #if 0 / #endif hack to bypass this warning if you want, but considering that you do not use them extensively to organize your code, it might be best to remove them entirely. This trick completely destroys the readability of those pragmas anyway...

I have not seen any other issues so far.