Browse Source

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

Vladimír Vondruš 13 years ago
parent
commit
a629582c09
  1. 6
      src/Shapes/Implementation/CollisionDispatch.cpp

6
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) \

Loading…
Cancel
Save