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

Extracted NOMINMAX and WIN32_LEAN_AND_MEAN guards into a proxy header

Commit
afe46ff27014d0324c76ca57c03f1a64632c3fdc
Author
Martin Hořeňovský ·
Parents
b3907a78e1bc

Files · Download .tar.gz

Changes

 include/internal/catch_console_colour_impl.hpp | 20 +---------------
 include/internal/catch_timer.hpp               | 14 +----------
 include/internal/catch_windows_h_proxy.h       | 32 ++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp
index 686fd710..ba2a9d1c 100644
--- a/include/internal/catch_console_colour_impl.hpp
+++ b/include/internal/catch_console_colour_impl.hpp
@@ -41,25 +41,7 @@ namespace Catch {
 
 #if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) /////////////////////////////////////////
 
-#  ifdef CATCH_DEFINES_NOMINMAX
-#    define NOMINMAX
-#  endif
-#  ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
-#    define WIN32_LEAN_AND_MEAN
-#  endif
-
-#ifdef __AFXDLL
-#include <AfxWin.h>
-#else
-#include <windows.h>
-#endif
-
-#  ifdef CATCH_DEFINES_NOMINMAX
-#    undef NOMINMAX
-#  endif
-#  ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
-#    undef WIN32_LEAN_AND_MEAN
-#  endif
+#include "catch_windows_h_proxy.h"
 
 namespace Catch {
 namespace {
diff --git a/include/internal/catch_timer.hpp b/include/internal/catch_timer.hpp
index ee14867f..00adfc3b 100644
--- a/include/internal/catch_timer.hpp
+++ b/include/internal/catch_timer.hpp
@@ -15,19 +15,7 @@
 #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
+#include "catch_windows_h_proxy.h"
 #else
 #include <sys/time.h>
 #endif
diff --git a/include/internal/catch_windows_h_proxy.h b/include/internal/catch_windows_h_proxy.h
new file mode 100644
index 00000000..4f059b4a
--- /dev/null
+++ b/include/internal/catch_windows_h_proxy.h
@@ -0,0 +1,32 @@
+/*
+ *  Created by Martin on 16/01/2017.
+ *
+ *  Distributed under the Boost Software License, Version 1.0. (See accompanying
+ *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#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
+#endif
+
+#ifdef __AFXDLL
+#include <AfxWin.h>
+#else
+#include <windows.h>
+#endif
+
+#ifdef CATCH_DEFINES_NOMINMAX
+#  undef NOMINMAX
+#endif
+#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
+#  undef WIN32_LEAN_AND_MEAN
+#endif
+
+
+#endif // TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED