From fbfb060b46e1d9588d84e850bdecf04e6c92b6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 20 Dec 2019 18:55:30 +0100 Subject: [PATCH] Animation: export just the function to avoid clang-cl complaining. If it's on the class, it complains it's ignored. --- src/Magnum/Animation/Interpolation.h | 60 ++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/src/Magnum/Animation/Interpolation.h b/src/Magnum/Animation/Interpolation.h index e73b19b94..6b39ec079 100644 --- a/src/Magnum/Animation/Interpolation.h +++ b/src/Magnum/Animation/Interpolation.h @@ -339,29 +339,73 @@ template<> struct TypeTraits: TypeTraitsBool {}; template struct TypeTraits, Math::BoolVector>: TypeTraitsBool> {}; /* Complex, preferring slerp() as it is more precise */ -template struct MAGNUM_EXPORT TypeTraits, Math::Complex> { +template struct +#ifndef CORRADE_TARGET_CLANG_CL +/* Clang-CL complains that it's ignored if it's on the class, so putting it + on the function instead. However MSVC doesn't like that, so doing this only + for Clang-CL. */ +MAGNUM_EXPORT +#endif +TypeTraits, Math::Complex> { typedef Math::Complex(*Interpolator)(const Math::Complex&, const Math::Complex&, Float); - static Interpolator interpolator(Interpolation interpolation); + static + #ifdef CORRADE_TARGET_CLANG_CL + MAGNUM_EXPORT + #endif + Interpolator interpolator(Interpolation interpolation); }; /* Quaternions and dual quaternions, preferring slerp() as it is more precise */ -template struct MAGNUM_EXPORT TypeTraits, Math::Quaternion> { +template struct +#ifndef CORRADE_TARGET_CLANG_CL +/* Clang-CL complains that it's ignored if it's on the class, so putting it + on the function instead. However MSVC doesn't like that, so doing this only + for Clang-CL. */ +MAGNUM_EXPORT +#endif +TypeTraits, Math::Quaternion> { typedef Math::Quaternion(*Interpolator)(const Math::Quaternion&, const Math::Quaternion&, Float); - static Interpolator interpolator(Interpolation interpolation); + static + #ifdef CORRADE_TARGET_CLANG_CL + MAGNUM_EXPORT + #endif + Interpolator interpolator(Interpolation interpolation); }; -template struct MAGNUM_EXPORT TypeTraits, Math::DualQuaternion> { +template struct +#ifndef CORRADE_TARGET_CLANG_CL +/* Clang-CL complains that it's ignored if it's on the class, so putting it + on the function instead. However MSVC doesn't like that, so doing this only + for Clang-CL. */ +MAGNUM_EXPORT +#endif +TypeTraits, Math::DualQuaternion> { typedef Math::DualQuaternion(*Interpolator)(const Math::DualQuaternion&, const Math::DualQuaternion&, Float); - static Interpolator interpolator(Interpolation interpolation); + static + #ifdef CORRADE_TARGET_CLANG_CL + MAGNUM_EXPORT + #endif + Interpolator interpolator(Interpolation interpolation); }; /* Cubic Hermite spline point has a different result type */ -template struct MAGNUM_EXPORT TypeTraits, T> { +template struct +#ifndef CORRADE_TARGET_CLANG_CL +/* Clang-CL complains that it's ignored if it's on the class, so putting it + on the function instead. However MSVC doesn't like that, so doing this only + for Clang-CL. */ +MAGNUM_EXPORT +#endif +TypeTraits, T> { typedef T(*Interpolator)(const Math::CubicHermite&, const Math::CubicHermite&, Float); - static Interpolator interpolator(Interpolation interpolation); + static + #ifdef CORRADE_TARGET_CLANG_CL + MAGNUM_EXPORT + #endif + Interpolator interpolator(Interpolation interpolation); }; }