summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-12-12 13:56:16 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-12-12 13:56:16 +0000
commit96cd56925bbda4ccb837f3eb240250a8fc7e21c9 (patch)
treebaf82f41c79d9381647444434823e6a946c386db
parentd3a05810c6855dbd8664b29a984726d80f42d3dd (diff)
Add missing macros, MIN, MAX, ABS and CLAMP to eglib.
-rw-r--r--eglib/gmain.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/eglib/gmain.h b/eglib/gmain.h
index 172031ac..2ed00fb3 100644
--- a/eglib/gmain.h
+++ b/eglib/gmain.h
@@ -66,6 +66,18 @@ typedef enum {
#define TRUE (!FALSE)
#endif
+#undef MAX
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+#undef MIN
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+
+#undef ABS
+#define ABS(a) (((a) < 0) ? -(a) : (a))
+
+#undef CLAMP
+#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
+
typedef enum {
G_IO_IN = POLLIN,
G_IO_OUT = POLLOUT,