diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index fab93c1c2..e0dfd7b20 100644 --- a/src/util.h +++ b/src/util.h @@ -2,6 +2,8 @@ #define INCLUDE_util_h__ #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) +#define bitsizeof(x) (CHAR_BIT * sizeof(x)) +#define MSB(x, bits) ((x) & (~0ULL << (bitsizeof(x) - (bits)))) /* * Don't wrap malloc/calloc. |