Browse Source

GCC 4.4 compatibility: no comparison operators for strongly-typed enums.

Vladimír Vondruš 12 years ago
parent
commit
045f463194
  1. 6
      src/Magnum/Shapes/Implementation/CollisionDispatch.cpp

6
src/Magnum/Shapes/Implementation/CollisionDispatch.cpp

@ -67,7 +67,8 @@ template<> bool collides(const AbstractShape<2>& a, const AbstractShape<2>& b) {
}
template<> Collision<2> collision(const AbstractShape<2>& a, const AbstractShape<2>& b) {
if(a.type() < b.type()) return collision(b, a);
/* GCC 4.4 doesn't have comparison operators for strongly typed enums */
if(UnsignedInt(a.type()) < UnsignedInt(b.type())) return collision(b, a);
switch(UnsignedInt(a.type())*UnsignedInt(b.type())) {
#define _c(aType, aClass, bType, bClass) \
@ -114,7 +115,8 @@ template<> bool collides(const AbstractShape<3>& a, const AbstractShape<3>& b) {
}
template<> Collision<3> collision(const AbstractShape<3>& a, const AbstractShape<3>& b) {
if(a.type() < b.type()) return collision(b, a);
/* GCC 4.4 doesn't have comparison operators for strongly typed enums */
if(UnsignedInt(a.type()) < UnsignedInt(b.type())) return collision(b, a);
switch(UnsignedInt(a.type())*UnsignedInt(b.type())) {
#define _c(aType, aClass, bType, bClass) \

Loading…
Cancel
Save