From b136d646d0046954fa6a55669dcbb82b715f9668 Mon Sep 17 00:00:00 2001 From: jakcron Date: Sat, 22 Sep 2018 22:22:56 +0800 Subject: [PATCH] [fnd] Add more macros to BitMath.h --- lib/libfnd/include/fnd/BitMath.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libfnd/include/fnd/BitMath.h b/lib/libfnd/include/fnd/BitMath.h index f3a4ceb..722036a 100644 --- a/lib/libfnd/include/fnd/BitMath.h +++ b/lib/libfnd/include/fnd/BitMath.h @@ -1,8 +1,6 @@ /* BitMath.h (c) 2018 Jakcron - -This is a 0x40 byte header to prepend to raw EXEFS .code binaries that provide enough data to be equivalent to an ELF. */ #pragma once @@ -12,3 +10,5 @@ This is a 0x40 byte header to prepend to raw EXEFS .code binaries that provide e // Bit math macros #define _BIT(n) BIT(n) #define _HAS_BIT(val, bit) (((val) & _BIT(bit)) != 0) +#define _SET_BIT(val, bit) ((val) |= _BIT(bit)) +#define _BITMASK(width) (_BIT(width)-1) \ No newline at end of file