macros: add macro to specify a bit mask range
This commit is contained in:
parent
159a4e83b4
commit
7d0dcfaae5
1 changed files with 1 additions and 0 deletions
|
@ -30,3 +30,4 @@
|
|||
/* Bit manipulation */
|
||||
#define BIT_SIZE(t) (CHAR_BIT * sizeof(t))
|
||||
#define BIT(n) (1 << (n))
|
||||
#define BITS(_start, _end) ((BIT(_end) - BIT(_start)) + BIT(_end))
|
||||
|
|
Loading…
Add table
Reference in a new issue