Copy project
This commit is contained in:
parent
ce7a467af7
commit
26a0fd884f
1 changed files with 157458 additions and 1 deletions
11
ad_astra/AdAstra/src/macros/bitwise.h
Normal file
11
ad_astra/AdAstra/src/macros/bitwise.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef BITWISE_H
|
||||
#define BITWISE_H
|
||||
|
||||
#define BV(x) (1 << (x))
|
||||
#define modifyBit(P, B, V) ((P) = ((P) & ~BV(B)) | ((V) << B))
|
||||
#define setBit(P, B) ((P) |= BV(B))
|
||||
#define clearBit(P, B) ((P) &= ~BV(B))
|
||||
#define toggleBit(P, B) ((P) ^= BV(B))
|
||||
#define getBit(P, B) (((P) & BV(B)) >> (B))
|
||||
|
||||
#endif
|
||||
Loading…
Reference in a new issue