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

Wrap all uses in min and max in extra parentheses

This prevents `min` and `max` macros from windows headers (!@#$)
from breaking compilation.

Related to #1191
Commit
3fe4d394a585b89df51ec2eaa6307d33358e527f
Author
Martin Hořeňovský ·
Parents
b97e9a2f8b35

Files · Download .tar.gz

Changes

 include/internal/catch_test_case_registry_impl.hpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/internal/catch_test_case_registry_impl.hpp b/include/internal/catch_test_case_registry_impl.hpp
index 879884d6..43af1887 100644
--- a/include/internal/catch_test_case_registry_impl.hpp
+++ b/include/internal/catch_test_case_registry_impl.hpp
@@ -27,9 +27,9 @@ namespace Catch {
         result_type operator()( result_type n ) const { return std::rand() % n; }
 
 #ifdef CATCH_CONFIG_CPP11_SHUFFLE
-        static constexpr result_type min() { return 0; }
-        static constexpr result_type max() { return 1000000; }
-        result_type operator()() const { return std::rand() % max(); }
+        static constexpr result_type (min)() { return 0; }
+        static constexpr result_type (max)() { return 1000000; }
+        result_type operator()() const { return std::rand() % (max)(); }
 #endif
         template<typename V>
         static void shuffle( V& vector ) {