aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-09-06 09:11:03 +0200
committerBert <ber.t@gmx.com>2011-09-06 09:11:03 +0200
commit711494ad361dcce5075545b5886a5986f88b60ef (patch)
tree92c87628d23fedb9a5f1f2590356cf3c732c40cc /util.h
parent2bbdd2f5b9529ab7cebd8fafa5cd4aa491a24010 (diff)
Avoid conflicting macros
Diffstat (limited to 'util.h')
-rw-r--r--util.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/util.h b/util.h
index e762675..9d5dc1d 100644
--- a/util.h
+++ b/util.h
@@ -23,10 +23,14 @@
#include <stdarg.h>
#include <dirent.h>
-#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)