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
This commit is contained in:
Martin Hořeňovský 2018-02-23 13:06:52 +01:00
parent b97e9a2f8b
commit 3fe4d394a5

View File

@ -27,9 +27,9 @@ namespace Catch {
result_type operator()( result_type n ) const { return std::rand() % n; } result_type operator()( result_type n ) const { return std::rand() % n; }
#ifdef CATCH_CONFIG_CPP11_SHUFFLE #ifdef CATCH_CONFIG_CPP11_SHUFFLE
static constexpr result_type min() { return 0; } static constexpr result_type (min)() { return 0; }
static constexpr result_type max() { return 1000000; } static constexpr result_type (max)() { return 1000000; }
result_type operator()() const { return std::rand() % max(); } result_type operator()() const { return std::rand() % (max)(); }
#endif #endif
template<typename V> template<typename V>
static void shuffle( V& vector ) { static void shuffle( V& vector ) {