nstool/lib/libfnd/include/fnd/BitMath.h

14 lines
280 B
C
Raw Normal View History

2018-03-17 11:59:53 +00:00
/*
BitMath.h
(c) 2018 Jakcron
*/
#pragma once
// to be deprecated
#define BIT(n) (1ULL << (n))
// Bit math macros
#define _BIT(n) BIT(n)
2018-03-25 11:08:34 +00:00
#define _HAS_BIT(val, bit) (((val) & _BIT(bit)) != 0)
2018-09-22 14:22:56 +00:00
#define _SET_BIT(val, bit) ((val) |= _BIT(bit))
#define _BITMASK(width) (_BIT(width)-1)