Index: sys/sys/bitset.h =================================================================== --- sys/sys/bitset.h +++ sys/sys/bitset.h @@ -34,12 +34,14 @@ #ifndef _SYS_BITSET_H_ #define _SYS_BITSET_H_ +#define __constexpr_cond(expr) (__builtin_constant_p((expr)) && (expr)) + #define __bitset_mask(_s, n) \ - (1L << ((__bitset_words((_s)) == 1) ? \ + (1L << (__constexpr_cond(__bitset_words((_s)) == 1) ? \ (__size_t)(n) : ((n) % _BITSET_BITS))) #define __bitset_word(_s, n) \ - ((__bitset_words((_s)) == 1) ? 0 : ((n) / _BITSET_BITS)) + (__constexpr_cond(__bitset_words((_s)) == 1) ? 0 : ((n) / _BITSET_BITS)) #define BIT_CLR(_s, n, p) \ ((p)->__bits[__bitset_word(_s, n)] &= ~__bitset_mask((_s), (n)))