Workaround unfortunate macro definition in `windows.h`

This commit is contained in:
Martchus 2023-01-31 22:28:06 +01:00
parent a5a33bbcef
commit 4d96a82ed9
1 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,13 @@
#ifdef PLATFORM_WINDOWS
#include <windows.h>
// note: The windows header seriously defines a macro called "max" breaking the (common) use
// of std::numeric_limits in the subsequent code. So we need to undefine this macro. Note that
// this is not the case using mingw-w64 but it is happening with windows.h from Windows Kits
// version 10.0.22000.0 via Visual Studio 2022.
#ifdef max
#undef max
#endif
#endif
using namespace std;