From afe46ff27014d0324c76ca57c03f1a64632c3fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Mon, 16 Jan 2017 16:52:44 +0100 Subject: [PATCH] Extracted NOMINMAX and WIN32_LEAN_AND_MEAN guards into a proxy header --- .../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(-) create mode 100644 include/internal/catch_windows_h_proxy.h 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 -#else -#include -#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 -# 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 #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 +#else +#include +#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