aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common/common_types.h
diff options
context:
space:
mode:
authorGravatar Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-01-05 15:05:28 +0000
committerGravatar Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-01-05 16:38:12 +0000
commit66e06f65c40bfe5a602e456fa1f217b59b65ab7f (patch)
tree8d266af57f3c0cc001f6b5a34a76e864e6b1ecdb /src/common/common_types.h
parentffe4cc9c5a0038dc7b721acb362867e5b1fd18b9 (diff)
Common: Use std::abs instead of abs, using abs with cmath fails on some systems.
Diffstat (limited to 'src/common/common_types.h')
-rw-r--r--src/common/common_types.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/common_types.h b/src/common/common_types.h
index 0e86cb2c..94e1406b 100644
--- a/src/common/common_types.h
+++ b/src/common/common_types.h
@@ -26,6 +26,7 @@
#include <cmath>
#include <cstdint>
+#include <cstdlib>
typedef std::uint8_t u8; ///< 8-bit unsigned byte
typedef std::uint16_t u16; ///< 16-bit unsigned short
@@ -83,8 +84,8 @@ public:
int x1_; ///< Rect bottom left X-coordinate
int y1_; ///< Rect bottom right Y-coordinate
- inline u32 width() const { return abs(x1_ - x0_); }
- inline u32 height() const { return abs(y1_ - y0_); }
+ inline u32 width() const { return std::abs(x1_ - x0_); }
+ inline u32 height() const { return std::abs(y1_ - y0_); }
inline bool operator == (const Rect& val) const {
return (x0_ == val.x0_ && y0_ == val.y0_ && x1_ == val.x1_ && y1_ == val.y1_);