diff options
Diffstat (limited to 'common/utils.h')
-rw-r--r-- | common/utils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/utils.h b/common/utils.h new file mode 100644 index 0000000..a7f8353 --- /dev/null +++ b/common/utils.h @@ -0,0 +1,11 @@ +#ifndef UTILS_H +#define UTILS_H + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif + +#define mint(x,y) ({(void)(&x == &y); x < y ? x : y; }) +#define maxt(x,y) ({(void)(&x == &y); x < y ? y : x; }) + +#endif |