From 413bd4639e5065a928b0f641cc1ca0b12fe517ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 00:30:36 +0100 Subject: [PATCH] MSVC 2013 compatibility: constexpr-related issues. --- src/Math/Algorithms/Svd.h | 2 +- src/Math/Test/Vector2Test.cpp | 2 +- src/Math/Test/Vector3Test.cpp | 2 +- src/Math/Test/Vector4Test.cpp | 2 +- src/Test/ColorTest.cpp | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Math/Algorithms/Svd.h b/src/Math/Algorithms/Svd.h index 186970969..0f0c1a1e4 100644 --- a/src/Math/Algorithms/Svd.h +++ b/src/Math/Algorithms/Svd.h @@ -97,7 +97,7 @@ decomposition and least squares solutions"*. template std::tuple, Vector, Matrix> svd(RectangularMatrix m) { static_assert(rows >= cols, "Unsupported matrix aspect ratio"); constexpr T tol = Implementation::smallestDelta()/TypeTraits::epsilon(); - #ifndef CORRADE_GCC45_COMPATIBILITY + #if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY) static_assert(T(1)+TypeTraits::epsilon() > T(1), "Epsilon too small"); static_assert(tol > T(0), "Tol too small"); #else diff --git a/src/Math/Test/Vector2Test.cpp b/src/Math/Test/Vector2Test.cpp index 000c1113c..e96e9c961 100644 --- a/src/Math/Test/Vector2Test.cpp +++ b/src/Math/Test/Vector2Test.cpp @@ -222,7 +222,7 @@ void Vector2Test::minmax() { void Vector2Test::swizzleType() { constexpr Vector<4, Int> orig; - #ifndef CORRADE_GCC45_COMPATIBILITY + #if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY) constexpr #else const diff --git a/src/Math/Test/Vector3Test.cpp b/src/Math/Test/Vector3Test.cpp index 48402ee84..b62707078 100644 --- a/src/Math/Test/Vector3Test.cpp +++ b/src/Math/Test/Vector3Test.cpp @@ -236,7 +236,7 @@ void Vector3Test::twoComponent() { void Vector3Test::swizzleType() { constexpr Vector<4, Int> orig; - #ifndef CORRADE_GCC45_COMPATIBILITY + #if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY) constexpr #else const diff --git a/src/Math/Test/Vector4Test.cpp b/src/Math/Test/Vector4Test.cpp index cfba9f712..2e6d4abda 100644 --- a/src/Math/Test/Vector4Test.cpp +++ b/src/Math/Test/Vector4Test.cpp @@ -227,7 +227,7 @@ void Vector4Test::twoComponent() { void Vector4Test::swizzleType() { constexpr Vector4i orig; - #ifndef CORRADE_GCC45_COMPATIBILITY + #if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY) constexpr #else const diff --git a/src/Test/ColorTest.cpp b/src/Test/ColorTest.cpp index 6d31d526f..dfb5897e3 100644 --- a/src/Test/ColorTest.cpp +++ b/src/Test/ColorTest.cpp @@ -296,7 +296,7 @@ void ColorTest::swizzleType() { constexpr Color3 origColor3; constexpr BasicColor4 origColor4; - #ifndef CORRADE_GCC45_COMPATIBILITY + #if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY) constexpr #else const @@ -304,7 +304,7 @@ void ColorTest::swizzleType() { auto a = Math::swizzle<'y', 'z', 'r'>(origColor3); CORRADE_VERIFY((std::is_same::value)); - #ifndef CORRADE_GCC45_COMPATIBILITY + #if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY) constexpr #else const @@ -312,7 +312,7 @@ void ColorTest::swizzleType() { auto b = Math::swizzle<'y', 'z', 'a'>(origColor4); CORRADE_VERIFY((std::is_same>::value)); - #ifndef CORRADE_GCC45_COMPATIBILITY + #if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY) constexpr #else const @@ -320,7 +320,7 @@ void ColorTest::swizzleType() { auto c = Math::swizzle<'y', 'z', 'y', 'x'>(origColor3); CORRADE_VERIFY((std::is_same::value)); - #ifndef CORRADE_GCC45_COMPATIBILITY + #if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY) constexpr #else const