You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
Latest release of catch2 doesn't build on windows if Windows.h was at any point included before it and NOMINMAX is not defined. Line causes 4487 multiple errors and causes any program including it to fail to build.
C:\Git-Projects\apex\build-windows-Debug\catch2\src\git_catch\single_include\catch2\catch.hpp(4487): warning C4003: not enough arguments for function-like macro invocation 'min'
C:\Git-Projects\apex\build-windows-Debug\catch2\src\git_catch\single_include\catch2\catch.hpp(4487): error C2059: syntax error: ')'
C:\Git-Projects\apex\build-windows-Debug\catch2\src\git_catch\single_include\catch2\catch.hpp(4487): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
Expected behavior
Should compile regardless of the macro being set
Reproduction steps
Just create a CPP that includes Windows.h before catch.hpp and windows will fail to compile if you don't have the NOMINMAX macro defined
Platform information:
OS: Windows 10
Compiler+version: Visual Studio v16.0.4
Catch version: v2.10.0
Additional context
I simply added -DNOMINMAX to my cmake compile scripts to get it to build. Probably something I should have done before.
Fix is easy though, if I change line 4487 in single_include/catch.hpp:
Bug description
Latest release of catch2 doesn't build on windows if Windows.h was at any point included before it and
NOMINMAX
is not defined. Line causes 4487 multiple errors and causes any program including it to fail to build.Expected behavior
Should compile regardless of the macro being set
Reproduction steps
Just create a CPP that includes Windows.h before catch.hpp and windows will fail to compile if you don't have the
NOMINMAX
macro definedPlatform information:
Additional context
I simply added
-DNOMINMAX
to my cmake compile scripts to get it to build. Probably something I should have done before.Fix is easy though, if I change line 4487 in single_include/catch.hpp:
to
It compiles without issues even without
NOMINMAX
The text was updated successfully, but these errors were encountered: