flamewing / mdcomp

Assorted compression formats for the Sega Mega Drive
Other
45 stars 4 forks source link

Some problems building with MSVC #6

Closed Clownacy closed 6 years ago

Clownacy commented 6 years ago

In basic_decoder.hh, I had to add an #undef max, so the line Src.ignore(std::numeric_limits<std::streamsize>::max()); would compile correctly.

I also had to remove the #elif defined(_MSC_VER) code in slog2 in enigma.cc because _BitScanReverse and the uninitialised variable apparently aren't constexpr-friendly.

flamewing commented 6 years ago

Out of curiosity, what version of the MSVC compiler are you using? I just discovered that up to 19.10, they are not fully c++14 compliant, and I will have to add a workaround in some code I am optimizing.

Clownacy commented 6 years ago

19.14.26433. I just updated to Visual Studio 15.7.5.

flamewing commented 6 years ago

Then you are safe. Anyway, it if fixed locally; will close it when I push the changes.

flamewing commented 6 years ago

Another possibility for max: can you edit your project to globally define NOMINMAX (in VS2015, it was Properties -> C/C++ -> Preprocessor -> append to Preprocessor Definitions).

Doing this way has the advantage that it prevents the issue from happening in the future.

Clownacy commented 6 years ago

Oh, didn't know about that. Yeah, that works.