From 56a3aebf7378dfc2ad59baa8bc23e0c8a3c4cb4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 7 Jan 2026 22:15:24 +0100 Subject: [PATCH] Math: fix swizzle support for Vector3 and Vector4 in singles. The macro, which is enabled when preprocessing the headers for single-header libs, excluded the TypeForSize specializations, making these two not work with Math::gather() and Math::scatter(). It's done correctly in Vector2 and Color, not sure why not here. --- src/Magnum/Math/Vector3.h | 5 ++--- src/Magnum/Math/Vector4.h | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Magnum/Math/Vector3.h b/src/Magnum/Math/Vector3.h index a89ee27d8..0d720d23d 100644 --- a/src/Magnum/Math/Vector3.h +++ b/src/Magnum/Math/Vector3.h @@ -287,13 +287,12 @@ template class Vector3: public Vector<3, T> { _MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(3, Vector3) #endif -#ifndef MAGNUM_NO_MATH_STRICT_WEAK_ORDERING namespace Implementation { template struct TypeForSize<3, T> { typedef Math::Vector3 Type; }; - + #ifndef MAGNUM_NO_MATH_STRICT_WEAK_ORDERING template struct StrictWeakOrdering>: StrictWeakOrdering> {}; + #endif } -#endif }} diff --git a/src/Magnum/Math/Vector4.h b/src/Magnum/Math/Vector4.h index 903961387..0fe1ee322 100644 --- a/src/Magnum/Math/Vector4.h +++ b/src/Magnum/Math/Vector4.h @@ -314,13 +314,12 @@ template Vector4 planeEquation(const Vector3& normal, const Vecto return {normal, -Math::dot(normal, point)}; } -#ifndef MAGNUM_NO_MATH_STRICT_WEAK_ORDERING namespace Implementation { template struct TypeForSize<4, T> { typedef Math::Vector4 Type; }; - + #ifndef MAGNUM_NO_MATH_STRICT_WEAK_ORDERING template struct StrictWeakOrdering>: StrictWeakOrdering> {}; + #endif } -#endif }}