diff options
Diffstat (limited to 'src/util/util.h')
| -rwxr-xr-x | src/util/util.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util/util.h b/src/util/util.h new file mode 100755 index 0000000..6f447e6 --- /dev/null +++ b/src/util/util.h @@ -0,0 +1,13 @@ +#ifndef UTIL_H +#define UTIL_H + +#define ARRAY_LEN(first, ...) \ + (sizeof(((typeof(first) []){first, __VA_ARGS__}))/(sizeof(typeof(first)))) + +#define bool_equal(a,b) ({ \ + typeof(a) _a = (a); \ + typeof(b) _b = (b); \ + ((_a) ? (_b) : (!(_b))); \ +}) + +#endif |
