Added NOMINMAX and WIN32_LEAN_AND_MEAN defines before including windows.h

This stops the `windows.h` header from defining `min` and `max` macros
and including lot of Windows APIs that are not needed by Catch.
This commit is contained in:
Martin Hořeňovský committed 2017-01-12 16:00:02 +01:00
1 parent b0de6c938a
commit b3907a78e1
4 files changed
+44 -7

No files matched your search

+12
View File
@@ -15,7 +15,19 @@
#endif
#ifdef CATCH_PLATFORM_WINDOWS
# ifdef CATCH_DEFINES_NOMINMAX
# define NOMINMAX
# endif
# ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
#include <windows.h>
# ifdef CATCH_DEFINES_NOMINMAX
# undef NOMINMAX
# endif
# ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
# undef WIN32_LEAN_AND_MEAN
# endif
#else
#include <sys/time.h>
#endif