From a629582c0925fd98615564ef0f96e524d3e31d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 4 Jun 2013 20:51:17 +0200 Subject: [PATCH] GCC 4.4 compatibility: no comparison operators for strongly typed enums. --- src/Shapes/Implementation/CollisionDispatch.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Shapes/Implementation/CollisionDispatch.cpp b/src/Shapes/Implementation/CollisionDispatch.cpp index f359d059f..dc1dfb713 100644 --- a/src/Shapes/Implementation/CollisionDispatch.cpp +++ b/src/Shapes/Implementation/CollisionDispatch.cpp @@ -36,7 +36,8 @@ namespace Magnum { namespace Shapes { namespace Implementation { template<> bool collides(const AbstractShape<2>* const a, const AbstractShape<2>* const b) { - if(a->type() < b->type()) return collides(b, a); + /* GCC 4.4 doesn't have comparison operators for strongly typed enums */ + if(UnsignedInt(a->type()) < UnsignedInt(b->type())) return collides(b, a); switch(UnsignedInt(a->type())*UnsignedInt(b->type())) { #define _c(aType, aClass, bType, bClass) \ @@ -58,7 +59,8 @@ template<> bool collides(const AbstractShape<2>* const a, const AbstractShape<2> } template<> bool collides(const AbstractShape<3>* const a, const AbstractShape<3>* const b) { - if(a->type() < b->type()) return collides(b, a); + /* GCC 4.4 doesn't have comparison operators for strongly typed enums */ + if(UnsignedInt(a->type()) < UnsignedInt(b->type())) return collides(b, a); switch(UnsignedInt(a->type())*UnsignedInt(b->type())) { #define _c(aType, aClass, bType, bClass) \