From: TimePath Date: Wed, 6 May 2015 09:30:38 +0000 (+1000) Subject: Add two useful macros X-Git-Tag: xonotic-v0.8.1~61^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=79e46cf03c19d2844151c4268252c332dda3c9ae;p=xonotic%2Fxonotic-data.pk3dir.git Add two useful macros --- diff --git a/qcsrc/common/util-pre.qh b/qcsrc/common/util-pre.qh index b3aacfa97..a1ac7dc7a 100644 --- a/qcsrc/common/util-pre.qh +++ b/qcsrc/common/util-pre.qh @@ -51,4 +51,7 @@ [[deprecated("use true")]] [[alias("true")]] const bool TRUE; [[deprecated("use false")]] [[alias("false")]] const bool FALSE; +#define BIT(n) (1 << (n)) +#define BITSET(var, mask, flag) (flag ? (var) | (mask) : (var) &~ (mask)) + #endif