From c98596740d11dc987ef9df4c17a3213778dc6855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 29 Apr 2015 20:29:39 +0200 Subject: [PATCH] Math: disable annoying warning on MSVC. I refuse to accept that this is acceptable behavior. --- src/Magnum/Math/Constants.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Magnum/Math/Constants.h b/src/Magnum/Math/Constants.h index a3f7670f6..0199dff79 100644 --- a/src/Magnum/Math/Constants.h +++ b/src/Magnum/Math/Constants.h @@ -109,7 +109,16 @@ template<> struct Constants { static constexpr Float sqrt3() { return 1.732050808f; } static constexpr Float nan() { return NAN; } + + /* MSVC emits overflow warning _by design_. Uhh. */ + #ifdef CORRADE_MSVC2013_COMPATIBILITY + #pragma warning(push) + #pragma warning(disable: 4756) + #endif static constexpr Float inf() { return INFINITY; } + #ifdef CORRADE_MSVC2013_COMPATIBILITY + #pragma warning(pop) + #endif }; #endif