diff options
| author | Martin Hořeňovský | 2022-02-05 16:21:06 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-02-05 16:21:06 +0100 |
| commit | c912f62fc46b2c1ab048399a5dadda703952dddf (patch) | |
| tree | d57fd73886168fb3ec4519d454b10946628f36ff | |
| parent | aa3c7be434c707aabe292c069c5c90d3cb25ada5 (diff) | |
| download | catch3-c912f62fc46b2c1ab048399a5dadda703952dddf.tar.gz | |
Remove Windows.h related defines
| -rw-r--r-- | docs/configuration.md | 8 | ||||
| -rw-r--r-- | src/catch2/internal/catch_windows_h_proxy.hpp | 15 |
2 files changed, 4 insertions, 19 deletions
diff --git a/docs/configuration.md b/docs/configuration.md index fa77ef54..a7db4b13 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -11,7 +11,6 @@ [C++11 toggles](#c11-toggles)<br> [C++17 toggles](#c17-toggles)<br> [Other toggles](#other-toggles)<br> -[Windows header clutter](#windows-header-clutter)<br> [Enabling stringification](#enabling-stringification)<br> [Disabling exceptions](#disabling-exceptions)<br> [Overriding Catch's debug break (`-b`)](#overriding-catchs-debug-break--b)<br> @@ -181,13 +180,6 @@ This feature is considered experimental and might change at any point. _Inspired by Doctest's `DOCTEST_CONFIG_DISABLE`_ -## Windows header clutter - -On Windows Catch includes `windows.h`. To minimize global namespace clutter in the implementation file, it defines `NOMINMAX` and `WIN32_LEAN_AND_MEAN` before including it. You can control this behaviour via two macros: - - CATCH_CONFIG_NO_NOMINMAX // Stops Catch from using NOMINMAX macro - CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN // Stops Catch from using WIN32_LEAN_AND_MEAN macro - ## Enabling stringification diff --git a/src/catch2/internal/catch_windows_h_proxy.hpp b/src/catch2/internal/catch_windows_h_proxy.hpp index a4c11fa6..14fe747d 100644 --- a/src/catch2/internal/catch_windows_h_proxy.hpp +++ b/src/catch2/internal/catch_windows_h_proxy.hpp @@ -12,12 +12,12 @@ #if defined(CATCH_PLATFORM_WINDOWS) -#if !defined(NOMINMAX) && !defined(CATCH_CONFIG_NO_NOMINMAX) -# define CATCH_DEFINED_NOMINMAX +// We might end up with the define made globally through the compiler, +// and we don't want to trigger warnings for this +#if !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 +#if !defined(WIN32_LEAN_AND_MEAN) # define WIN32_LEAN_AND_MEAN #endif @@ -27,13 +27,6 @@ #include <windows.h> #endif -#ifdef CATCH_DEFINED_NOMINMAX -# undef NOMINMAX -#endif -#ifdef CATCH_DEFINED_WIN32_LEAN_AND_MEAN -# undef WIN32_LEAN_AND_MEAN -#endif - #endif // defined(CATCH_PLATFORM_WINDOWS) #endif // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED |