Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-01-15 00:24:37 +0100
committerMartin Hořeňovský2023-01-18 11:57:00 +0100
commite27bb7198d351d5b3db21d3c9dd81b5002545682 (patch)
tree96a16174ecdab51579a305b831bd35b37ae0f695 /src/catch2
parent3486f8ed9ed6a0832438bf29693626e10ad85bd4 (diff)
downloadcatch3-e27bb7198d351d5b3db21d3c9dd81b5002545682.tar.gz
Fix macro-redefinition issue with MSVC+CUDA
Closes #2603
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/internal/catch_compiler_capabilities.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/catch2/internal/catch_compiler_capabilities.hpp b/src/catch2/internal/catch_compiler_capabilities.hpp
index d457a4b4..0c41c93e 100644
--- a/src/catch2/internal/catch_compiler_capabilities.hpp
+++ b/src/catch2/internal/catch_compiler_capabilities.hpp
@@ -181,8 +181,14 @@
// Visual C++
#if defined(_MSC_VER)
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
+// We want to defer to nvcc-specific warning suppression if we are compiled
+// with nvcc masquerading for MSVC.
+# if !defined( __CUDACC__ )
+# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ __pragma( warning( push ) )
+# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ __pragma( warning( pop ) )
+# endif
// Universal Windows platform does not support SEH
// Or console colours (or console at all...)