diff options
| author | Nakidai <nakidai@disroot.org> | 2026-01-07 05:59:01 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2026-01-07 05:59:01 +0300 |
| commit | 8469256066dc37ac89c2258677f9d47adfca2031 (patch) | |
| tree | e019879792c079cdf0582a16d166f97597814339 /ircd.h | |
| parent | 5cbbb8342feea527bfe3a5650d7c6a461254964a (diff) | |
| download | libreircd-8469256066dc37ac89c2258677f9d47adfca2031.tar.gz libreircd-8469256066dc37ac89c2258677f9d47adfca2031.zip | |
Add comments for some macros
Diffstat (limited to 'ircd.h')
| -rw-r--r-- | ircd.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ircd.h b/ircd.h index 07bdd0f..6035b79 100644 --- a/ircd.h +++ b/ircd.h @@ -30,6 +30,10 @@ #define BIT(x) x##_BIT, x = 1 << x##_BIT, x##_BIT_ = x##_BIT #define lengthof(X) (sizeof(X) / sizeof(*(X))) + +/* when `ensure' is used, it's better to think of it like it's the condition under which code + * below "exists" (so, ensure that `cond' evaluates to true), and not like it's a condition when + * to stop, trying to invert cond */ #define ensure(cond, iffalse, doexit) if (!(cond)) { iffalse; if (doexit >= 0) return doexit; } struct Message |