diff options
author | Bert <ber.t@gmx.com> | 2011-09-06 09:11:03 +0200 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-09-06 09:11:03 +0200 |
commit | 711494ad361dcce5075545b5886a5986f88b60ef (patch) | |
tree | 92c87628d23fedb9a5f1f2590356cf3c732c40cc /util.h | |
parent | 2bbdd2f5b9529ab7cebd8fafa5cd4aa491a24010 (diff) |
Avoid conflicting macros
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |