diff --git a/libraries/libvapours/include/vapours/types.hpp b/libraries/libvapours/include/vapours/types.hpp index 0d4b4b6f0..d77ea21fe 100644 --- a/libraries/libvapours/include/vapours/types.hpp +++ b/libraries/libvapours/include/vapours/types.hpp @@ -69,12 +69,12 @@ typedef u32 Result; ///< Function error code result type. /// Creates a bitmask for bit range extraction. #ifndef MASK2 -#define MASK2(a,b) (MASK(a) & ~MASK(b)) +#define MASK2(a,b) (MASK((a) + 1) & ~MASK(b)) #endif /// Creates a bitmask for bit range extraction (long). #ifndef MASK2L -#define MASK2L(a,b) (MASKL(a) & ~MASKL(b)) +#define MASK2L(a,b) (MASKL((a) + 1) & ~MASKL(b)) #endif /// Marks a function as not returning, for the purposes of compiler optimization.