diff --git a/doc/changelog.dox b/doc/changelog.dox index af710e9cd..ea508cadd 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -737,6 +737,8 @@ See also: off-by-one on desktop GLSL < 330. - Fixed assertions related to OpenGL driver workarounds when the proprietary AMDGPU PRO drivers are used on Linux +- Fixed @relativeref{Corrade,Utility::Tweakable} parsers to compile with + negative @ref Math::Angle literals such as @cpp _(-15.0_degf) @ce - Fixed an assertion when using @ref MeshTools::removeDuplicates() on an interleaved @ref Trade::MeshData that included padding at the beginning or end of each vertex diff --git a/src/Magnum/Math/Angle.h b/src/Magnum/Math/Angle.h index 6c4b78f29..05f6dbcd3 100644 --- a/src/Magnum/Math/Angle.h +++ b/src/Magnum/Math/Angle.h @@ -270,6 +270,11 @@ template<> struct MAGNUM_EXPORT TweakableParser static std::pair> parse(Containers::StringView value); }; +#ifndef DOXYGEN_GENERATING_OUTPUT +/* Needed to parse e.g. -1.0_degf, which is the base class type */ +template<> struct TweakableParser>: TweakableParser> {}; +#endif + /** @tweakableliteral{Magnum::Math::Deg} @@ -283,6 +288,11 @@ template<> struct MAGNUM_EXPORT TweakableParser> parse(Containers::StringView value); }; +#ifndef DOXYGEN_GENERATING_OUTPUT +/* Needed to parse e.g. -1.0_deg, which is the base class type */ +template<> struct TweakableParser>: TweakableParser> {}; +#endif + /** @tweakableliteral{Magnum::Math::Rad} @@ -296,6 +306,11 @@ template<> struct MAGNUM_EXPORT TweakableParser static std::pair> parse(Containers::StringView value); }; +#ifndef DOXYGEN_GENERATING_OUTPUT +/* Needed to parse e.g. -1.0_radf, which is the base class type */ +template<> struct TweakableParser>: TweakableParser> {}; +#endif + /** @tweakableliteral{Magnum::Math::Rad} @@ -308,6 +323,11 @@ template<> struct MAGNUM_EXPORT TweakableParser> parse(Containers::StringView value); }; + +#ifndef DOXYGEN_GENERATING_OUTPUT +/* Needed to parse e.g. -1.0_rad, which is the base class type */ +template<> struct TweakableParser>: TweakableParser> {}; +#endif #endif }} diff --git a/src/Magnum/Math/Test/AngleTest.cpp b/src/Magnum/Math/Test/AngleTest.cpp index 2d232fa4b..beda9d72b 100644 --- a/src/Magnum/Math/Test/AngleTest.cpp +++ b/src/Magnum/Math/Test/AngleTest.cpp @@ -102,18 +102,34 @@ template<> struct TweakableTraits { static const char* name() { return "Deg"; } static const char* literal() { return "degf"; } }; +template<> struct TweakableTraits> { + static const char* name() { return "Unit"; } + static const char* literal() { return "degf"; } +}; template<> struct TweakableTraits { static const char* name() { return "Degd"; } static const char* literal() { return "deg"; } }; +template<> struct TweakableTraits> { + static const char* name() { return "Unit"; } + static const char* literal() { return "deg"; } +}; template<> struct TweakableTraits { static const char* name() { return "Rad"; } static const char* literal() { return "radf"; } }; +template<> struct TweakableTraits> { + static const char* name() { return "Unit"; } + static const char* literal() { return "radf"; } +}; template<> struct TweakableTraits { static const char* name() { return "Radd"; } static const char* literal() { return "rad"; } }; +template<> struct TweakableTraits> { + static const char* name() { return "Unit"; } + static const char* literal() { return "rad"; } +}; #endif AngleTest::AngleTest() { @@ -134,16 +150,24 @@ AngleTest::AngleTest() { #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT)) || defined(CORRADE_TARGET_EMSCRIPTEN) addInstancedTests({ &AngleTest::tweakable, + &AngleTest::tweakable>, &AngleTest::tweakable, + &AngleTest::tweakable>, &AngleTest::tweakable, - &AngleTest::tweakable}, + &AngleTest::tweakable>, + &AngleTest::tweakable, + &AngleTest::tweakable>}, Corrade::Containers::arraySize(TweakableData)); addInstancedTests({ &AngleTest::tweakableError, + &AngleTest::tweakableError>, &AngleTest::tweakableError, + &AngleTest::tweakableError>, &AngleTest::tweakableError, - &AngleTest::tweakableError}, + &AngleTest::tweakableError>, + &AngleTest::tweakableError, + &AngleTest::tweakableError>}, Corrade::Containers::arraySize(TweakableErrorData)); #endif }