diff options
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common.h b/src/common.h index f9d9f77..b1c3273 100644 --- a/src/common.h +++ b/src/common.h | |||
| @@ -54,9 +54,11 @@ | |||
| 54 | 54 | ||
| 55 | #define SYSCALL(call) while (((call) == -1) && (errno == EINTR)) | 55 | #define SYSCALL(call) while (((call) == -1) && (errno == EINTR)) |
| 56 | 56 | ||
| 57 | #define GETBIT(m, x) ((m>>(x))&1U) | 57 | #define BITMASK(x) (1U << (x)) |
| 58 | #define SETBIT(m, x) (m|=(1U<<(x))) | 58 | #define BITONES(x) (BITMASK(x) - 1U) |
| 59 | #define CLEARBIT(m, x) (m&=~(1U<<(x))) | 59 | #define GETBIT(m, x) (((m) >> (x)) & 1U) |
| 60 | #define SETBIT(m, x) (m |= BITMASK(x)) | ||
| 61 | #define CLEARBIT(m, x) (m &= ~BITMASK(x)) | ||
| 60 | 62 | ||
| 61 | //////////////////////////////////////////////////////// | 63 | //////////////////////////////////////////////////////// |
| 62 | 64 | ||
