src.dualinventive.com/dinet/libdi/include/di/bitops.h

20 lines
424 B
C

#ifndef LIBDI_INCLUDE_BITOPS_H_
#define LIBDI_INCLUDE_BITOPS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define DI_BIT_SET(value, bit) ((value) |= (1 << bit))
#define DI_BIT_CLEAR(value, bit) ((value) &= (1 << bit))
#define DI_BIT_TOGGLE(value, bit) ((value) ^= (1 << bit))
#define DI_BIT_ISSET(value, bit) (((value) >> bit) & 1)
#ifdef __cplusplus
}
#endif
#endif /* LIBDI_INCLUDE_BITOPS_H_ */