From 711494ad361dcce5075545b5886a5986f88b60ef Mon Sep 17 00:00:00 2001 From: Bert Date: Tue, 6 Sep 2011 09:11:03 +0200 Subject: Avoid conflicting macros --- util.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index e762675..9d5dc1d 100644 --- a/util.h +++ b/util.h @@ -23,10 +23,14 @@ #include #include -#define ABS(a) ((a) < 0 ? (-(a)) : (a)) +#ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif +#ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define LEN(a) (sizeof(a) / sizeof(a[0])) +#endif + +#define ARRLEN(a) (sizeof(a) / sizeof(a[0])) #define TIMEDIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec) * 1000 + \ ((t1)->tv_usec - (t2)->tv_usec) / 1000) -- cgit v1.2.3