Dynalib Utils
BitManip.h
Go to the documentation of this file.
1 //
2 // Created by Ken Kopelson on 14/10/17.
3 //
4 
5 #ifndef BITMANIP_H
6 #define BITMANIP_H
7 
8 #define SET_BITS(value, bits) ((value) |= (bits))
9 #define CLEAR_BITS(value, bits) ((value) &= ~(bits))
10 #define IS_ALL_SET(value, bits) (((value) & (bits)) == (bits))
11 #define IS_ANY_SET(value, bits) (((value) & (bits)) != 0)
12 #define IS_ALL_CLEAR(value, bits) (((value) & (bits)) == 0)
13 #define IS_ANY_CLEAR(value, bits) (!IS_ALL_SET(value, bits) && IS_ANY_SET(value, bits))
14 
15 #endif //BITMANIP_H