diff options
-rw-r--r-- | src/core/math_func.hpp | 12 | ||||
-rw-r--r-- | src/core/overflowsafe_type.hpp | 1 | ||||
-rw-r--r-- | src/safeguards.h | 15 |
3 files changed, 16 insertions, 12 deletions
diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index fd4110231..df9142462 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -12,18 +12,6 @@ #ifndef MATH_FUNC_HPP #define MATH_FUNC_HPP -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - -#ifdef abs -#undef abs -#endif - /** * Returns the maximum of two values. * diff --git a/src/core/overflowsafe_type.hpp b/src/core/overflowsafe_type.hpp index cfc245c6c..42ec98bd0 100644 --- a/src/core/overflowsafe_type.hpp +++ b/src/core/overflowsafe_type.hpp @@ -12,6 +12,7 @@ #ifndef OVERFLOWSAFE_TYPE_HPP #define OVERFLOWSAFE_TYPE_HPP +#include "math_func.hpp" /** * Overflow safe template for integers, i.e. integers that will never overflow diff --git a/src/safeguards.h b/src/safeguards.h index 12d704879..f447627e6 100644 --- a/src/safeguards.h +++ b/src/safeguards.h @@ -56,4 +56,19 @@ /* No clear replacement. */ #define strtok SAFEGUARD_DO_NOT_USE_THIS_METHOD +/* Use our own templated implementation instead of a macro or function with only one type. */ +#ifdef min +#undef min +#endif + +/* Use our own templated implementation instead of a macro or function with only one type. */ +#ifdef max +#undef max +#endif + +/* Use our own templated implementation instead of a macro or function with only one type. */ +#ifdef abs +#undef abs +#endif + #endif /* SAFEGUARDS_H */ |