blob: 110aae74a6bd851acd2dbb663ab48e5316ac2957 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#include <stdio.h>
#include <stdlib.h>
#ifndef UTIL_H
#define UTIL_H
#define SET_BIT(b, n) (b | (0x1 << n))
#define CLEAR_BIT(b, n) (b & ~(0x1 << n))
#define IS_BIT_SET(b, n) ((b >> n) & 0x1)
#define TOGGLE_BIT(b, n) (b ^ (0x1 << n))
#define HAS_FLAG(v, f) ((v & f) == f)
#endif
|