From: Christoph Sommer Date: Fri, 18 Aug 2006 13:50:54 +0000 (+0000) Subject: Tried fixing portability issue X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=77d00a6f464cc87c6b50cf1f3b38064a7ae9aead;p=supertux.git Tried fixing portability issue SVN-Revision: 4198 --- diff --git a/src/collision.hpp b/src/collision.hpp index 73c966dc8..ba6b6f8d9 100644 --- a/src/collision.hpp +++ b/src/collision.hpp @@ -22,6 +22,7 @@ #include #include "collision_hit.hpp" +#include class Vector; class Rect; @@ -34,15 +35,17 @@ class Constraints { public: Constraints() { - left = -INFINITY; - right = INFINITY; - top = -INFINITY; - bottom = INFINITY; + float infinity = (std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : std::numeric_limits::max()); + left = -infinity; + right = infinity; + top = -infinity; + bottom = infinity; } bool has_constraints() const { - return left > -INFINITY || right < INFINITY - || top > -INFINITY || bottom < INFINITY; + float infinity = (std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : std::numeric_limits::max()); + return left > -infinity || right < infinity + || top > -infinity || bottom < infinity; } float left;