macros: add macro to specify a bit mask range

tags/0.1.0
S.J.R. van Schaik 8 years ago
parent 159a4e83b4
commit 7d0dcfaae5
  1. 1
      include/macros.h

@ -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…
Cancel
Save