diff options
| author | Enrique | 2025-01-06 16:40:25 +0100 |
|---|---|---|
| committer | Enrique | 2025-01-06 16:40:25 +0100 |
| commit | 7f3fab3aab6a4de059277330fa52049033f022fc (patch) | |
| tree | b918c9dc8314463fb67cfbd1d33338b814d03a7a /src/util/util.h | |
| download | soikk-server-7f3fab3aab6a4de059277330fa52049033f022fc.tar.xz soikk-server-7f3fab3aab6a4de059277330fa52049033f022fc.tar.zst | |
Initial commit
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 |
