Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Move windows.h reduction logic into windows.h proxy header

Fixes #965 (at least the primary problem, the separate warnings can
be taken care of later)
Commit
0a3f899d6a63ae01bdc33c6a7c2d2eb8086db702
Author
Martin Hořeňovský ·
Parents
d118ce191d0f

Files · Download .tar.gz

Changes

 include/internal/catch_platform.h        |  6 ------
 include/internal/catch_windows_h_proxy.h | 20 +++++++++++++-------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/internal/catch_platform.h b/include/internal/catch_platform.h
index 87250c60..90cf0eb7 100644
--- a/include/internal/catch_platform.h
+++ b/include/internal/catch_platform.h
@@ -22,12 +22,6 @@
 
 #elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
 #  define CATCH_PLATFORM_WINDOWS
-#  if !defined(NOMINMAX) && !defined(CATCH_CONFIG_NO_NOMINMAX)
-#    define CATCH_DEFINES_NOMINMAX
-#  endif
-#  if !defined(WIN32_LEAN_AND_MEAN) && !defined(CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN)
-#    define CATCH_DEFINES_WIN32_LEAN_AND_MEAN
-#  endif
 #endif
 
 #endif // TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED
diff --git a/include/internal/catch_windows_h_proxy.h b/include/internal/catch_windows_h_proxy.h
index 4f059b4a..bbb1ee82 100644
--- a/include/internal/catch_windows_h_proxy.h
+++ b/include/internal/catch_windows_h_proxy.h
@@ -8,11 +8,17 @@
 #ifndef TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED
 #define TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED
 
-#ifdef CATCH_DEFINES_NOMINMAX
-#  define NOMINMAX
-#endif
-#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
-#  define WIN32_LEAN_AND_MEAN
+#include "catch_platform.h"
+
+#if defined(CATCH_PLATFORM_WINDOWS)
+#  if !defined(NOMINMAX) && !defined(CATCH_CONFIG_NO_NOMINMAX)
+#    define CATCH_DEFINED_NOMINMAX
+#    define NOMINMAX
+#  endif
+#  if !defined(WIN32_LEAN_AND_MEAN) && !defined(CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN)
+#    define CATCH_DEFINED_WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
 #endif
 
 #ifdef __AFXDLL
@@ -21,10 +27,10 @@
 #include <windows.h>
 #endif
 
-#ifdef CATCH_DEFINES_NOMINMAX
+#ifdef CATCH_DEFINED_NOMINMAX
 #  undef NOMINMAX
 #endif
-#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
+#ifdef CATCH_DEFINED_WIN32_LEAN_AND_MEAN
 #  undef WIN32_LEAN_AND_MEAN
 #endif