diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-12-12 13:56:16 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-12-12 13:56:16 +0000 |
commit | 96cd56925bbda4ccb837f3eb240250a8fc7e21c9 (patch) | |
tree | baf82f41c79d9381647444434823e6a946c386db /eglib/gmain.h | |
parent | d3a05810c6855dbd8664b29a984726d80f42d3dd (diff) |
Add missing macros, MIN, MAX, ABS and CLAMP to eglib.
Diffstat (limited to 'eglib/gmain.h')
-rw-r--r-- | eglib/gmain.h | 12 |
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, |