From d223e1ea9ae864c0e563187f1e76240ef1acad87 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 29 May 2020 14:25:19 -0600 Subject: handy.h: Create nBIT_MASK(n) macro This encapsulates a common paradigm, making sure that it is done correctly for the platform's size. --- op_reg_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'op_reg_common.h') diff --git a/op_reg_common.h b/op_reg_common.h index c500aa4180..e8770e6352 100644 --- a/op_reg_common.h +++ b/op_reg_common.h @@ -137,8 +137,8 @@ get_regex_charset(const U32 flags) * directly in the #define because doing so confuses regcomp.pl. * (2**n - 1) is n 1 bits, so the below gets the contiguous bits between the * beginning and ending shifts */ -#if RXf_PMf_COMPILETIME != (((1 << (_RXf_PMf_SHIFT_COMPILETIME))-1) \ - & (~((1 << RXf_PMf_STD_PMMOD_SHIFT)-1))) +#if RXf_PMf_COMPILETIME != ((nBIT_MASK(_RXf_PMf_SHIFT_COMPILETIME)) \ + & (~(nBIT_MASK( RXf_PMf_STD_PMMOD_SHIFT)))) # error RXf_PMf_COMPILETIME is invalid #endif -- cgit v1.2.1