bitflag_api_internal
include/bitflag_api_internal.h View source View on GitHubMacros
Section titled “Macros”BR_BITFLAG_RANGE_ASSERT
Section titled “BR_BITFLAG_RANGE_ASSERT”#define BR_BITFLAG_RANGE_ASSERT(lo, hi) source Expansion
#define BR_BITFLAG_RANGE_ASSERT(lo, hi) \
(sizeof(struct { \
static_assert((hi) >= (lo), "hi must be >= lo"); \
uint8_t _b; \
}) * \
0) BR_EVAL
Section titled “BR_EVAL”BR_EVAL64
Section titled “BR_EVAL64”BR_EVAL32
Section titled “BR_EVAL32”BR_EVAL16
Section titled “BR_EVAL16”BR_EVAL8
Section titled “BR_EVAL8”BR_EVAL4
Section titled “BR_EVAL4”BR_EVAL2
Section titled “BR_EVAL2”BR_EVAL1
Section titled “BR_EVAL1”BR_EMPTY
Section titled “BR_EMPTY”BR_DEFER
Section titled “BR_DEFER”BR_IIF
Section titled “BR_IIF”BR_IIF_0
Section titled “BR_IIF_0”BR_IIF_1
Section titled “BR_IIF_1”BR_HAS_COMMA
Section titled “BR_HAS_COMMA”#define BR_HAS_COMMA(...) source Expansion
#define BR_HAS_COMMA(...) BR_HAS_COMMA_EVAL(__VA_ARGS__, 1, 0, 0) BR_HAS_COMMA_EVAL
Section titled “BR_HAS_COMMA_EVAL”#define BR_HAS_COMMA_EVAL(_1, _2, N, ...) source Expansion
#define BR_HAS_COMMA_EVAL(_1, _2, N, ...) N BR_CMP_TOKEN
Section titled “BR_CMP_TOKEN”#define BR_CMP_TOKEN(a, b) source Expansion
#define BR_CMP_TOKEN(a, b) PP_CONCAT(BR_CMP_, PP_CONCAT(a, PP_CONCAT(_, b))) BR_IS_EQUAL
Section titled “BR_IS_EQUAL”#define BR_IS_EQUAL(a, b) source Expansion
#define BR_IS_EQUAL(a, b) BR_HAS_COMMA(BR_CMP_TOKEN(a, b)) BR_CMP_0_0
Section titled “BR_CMP_0_0”#define BR_CMP_0_0 , source BR_CMP_1_1
Section titled “BR_CMP_1_1”#define BR_CMP_1_1 , source BR_CMP_2_2
Section titled “BR_CMP_2_2”#define BR_CMP_2_2 , source BR_CMP_3_3
Section titled “BR_CMP_3_3”#define BR_CMP_3_3 , source BR_CMP_4_4
Section titled “BR_CMP_4_4”#define BR_CMP_4_4 , source BR_CMP_5_5
Section titled “BR_CMP_5_5”#define BR_CMP_5_5 , source BR_CMP_6_6
Section titled “BR_CMP_6_6”#define BR_CMP_6_6 , source BR_CMP_7_7
Section titled “BR_CMP_7_7”#define BR_CMP_7_7 , source BR_CMP_8_8
Section titled “BR_CMP_8_8”#define BR_CMP_8_8 , source BR_CMP_9_9
Section titled “BR_CMP_9_9”#define BR_CMP_9_9 , source BR_CMP_10_10
Section titled “BR_CMP_10_10”#define BR_CMP_10_10 , source BR_CMP_11_11
Section titled “BR_CMP_11_11”#define BR_CMP_11_11 , source BR_CMP_12_12
Section titled “BR_CMP_12_12”#define BR_CMP_12_12 , source BR_CMP_13_13
Section titled “BR_CMP_13_13”#define BR_CMP_13_13 , source BR_CMP_14_14
Section titled “BR_CMP_14_14”#define BR_CMP_14_14 , source BR_CMP_15_15
Section titled “BR_CMP_15_15”#define BR_CMP_15_15 , source BR_CMP_16_16
Section titled “BR_CMP_16_16”#define BR_CMP_16_16 , source BR_CMP_17_17
Section titled “BR_CMP_17_17”#define BR_CMP_17_17 , source BR_CMP_18_18
Section titled “BR_CMP_18_18”#define BR_CMP_18_18 , source BR_CMP_19_19
Section titled “BR_CMP_19_19”#define BR_CMP_19_19 , source BR_CMP_20_20
Section titled “BR_CMP_20_20”#define BR_CMP_20_20 , source BR_CMP_21_21
Section titled “BR_CMP_21_21”#define BR_CMP_21_21 , source BR_CMP_22_22
Section titled “BR_CMP_22_22”#define BR_CMP_22_22 , source BR_CMP_23_23
Section titled “BR_CMP_23_23”#define BR_CMP_23_23 , source BR_CMP_24_24
Section titled “BR_CMP_24_24”#define BR_CMP_24_24 , source BR_CMP_25_25
Section titled “BR_CMP_25_25”#define BR_CMP_25_25 , source BR_CMP_26_26
Section titled “BR_CMP_26_26”#define BR_CMP_26_26 , source BR_CMP_27_27
Section titled “BR_CMP_27_27”#define BR_CMP_27_27 , source BR_CMP_28_28
Section titled “BR_CMP_28_28”#define BR_CMP_28_28 , source BR_CMP_29_29
Section titled “BR_CMP_29_29”#define BR_CMP_29_29 , source BR_CMP_30_30
Section titled “BR_CMP_30_30”#define BR_CMP_30_30 , source BR_CMP_31_31
Section titled “BR_CMP_31_31”#define BR_CMP_31_31 , source BR_INC
Section titled “BR_INC”BR_INC_0
Section titled “BR_INC_0”#define BR_INC_0 1 source BR_INC_1
Section titled “BR_INC_1”#define BR_INC_1 2 source BR_INC_2
Section titled “BR_INC_2”#define BR_INC_2 3 source BR_INC_3
Section titled “BR_INC_3”#define BR_INC_3 4 source BR_INC_4
Section titled “BR_INC_4”#define BR_INC_4 5 source BR_INC_5
Section titled “BR_INC_5”#define BR_INC_5 6 source BR_INC_6
Section titled “BR_INC_6”#define BR_INC_6 7 source BR_INC_7
Section titled “BR_INC_7”#define BR_INC_7 8 source BR_INC_8
Section titled “BR_INC_8”#define BR_INC_8 9 source BR_INC_9
Section titled “BR_INC_9”#define BR_INC_9 10 source BR_INC_10
Section titled “BR_INC_10”#define BR_INC_10 11 source BR_INC_11
Section titled “BR_INC_11”#define BR_INC_11 12 source BR_INC_12
Section titled “BR_INC_12”#define BR_INC_12 13 source BR_INC_13
Section titled “BR_INC_13”#define BR_INC_13 14 source BR_INC_14
Section titled “BR_INC_14”#define BR_INC_14 15 source BR_INC_15
Section titled “BR_INC_15”#define BR_INC_15 16 source BR_INC_16
Section titled “BR_INC_16”#define BR_INC_16 17 source BR_INC_17
Section titled “BR_INC_17”#define BR_INC_17 18 source BR_INC_18
Section titled “BR_INC_18”#define BR_INC_18 19 source BR_INC_19
Section titled “BR_INC_19”#define BR_INC_19 20 source BR_INC_20
Section titled “BR_INC_20”#define BR_INC_20 21 source BR_INC_21
Section titled “BR_INC_21”#define BR_INC_21 22 source BR_INC_22
Section titled “BR_INC_22”#define BR_INC_22 23 source BR_INC_23
Section titled “BR_INC_23”#define BR_INC_23 24 source BR_INC_24
Section titled “BR_INC_24”#define BR_INC_24 25 source BR_INC_25
Section titled “BR_INC_25”#define BR_INC_25 26 source BR_INC_26
Section titled “BR_INC_26”#define BR_INC_26 27 source BR_INC_27
Section titled “BR_INC_27”#define BR_INC_27 28 source BR_INC_28
Section titled “BR_INC_28”#define BR_INC_28 29 source BR_INC_29
Section titled “BR_INC_29”#define BR_INC_29 30 source BR_INC_30
Section titled “BR_INC_30”#define BR_INC_30 31 source BR_RANGE_STOP
Section titled “BR_RANGE_STOP”#define BR_RANGE_STOP(curr, hi) source Expansion
#define BR_RANGE_STOP(curr, hi) BR_RANGE_CONT
Section titled “BR_RANGE_CONT”#define BR_RANGE_CONT(curr, hi) source Expansion
#define BR_RANGE_CONT(curr, hi) \
BR_DEFER(BR_RANGE_STEP_INDIRECT)()(BR_INC(curr), hi) BR_RANGE_STEP_INDIRECT
Section titled “BR_RANGE_STEP_INDIRECT”#define BR_RANGE_STEP_INDIRECT() source Expansion
#define BR_RANGE_STEP_INDIRECT() BR_RANGE_STEP BR_RANGE_STEP
Section titled “BR_RANGE_STEP”#define BR_RANGE_STEP(curr, hi) source Expansion
#define BR_RANGE_STEP(curr, hi) \
, curr BR_IIF(BR_IS_EQUAL(curr, hi))(BR_RANGE_STOP, BR_RANGE_CONT)(curr, hi) BR_RANGE_GENERATE_I
Section titled “BR_RANGE_GENERATE_I”#define BR_RANGE_GENERATE_I(lo, hi) source Expansion
#define BR_RANGE_GENERATE_I(lo, hi) \
(BR_BITFLAG_RANGE_ASSERT(lo, hi) + (lo)) BR_IIF(BR_IS_EQUAL(lo, hi))( \
BR_RANGE_STOP, BR_RANGE_STEP)(BR_INC(lo), hi) BITFLAG_RANGE
Section titled “BITFLAG_RANGE”#define BITFLAG_RANGE(lo, hi) source Expansion
#define BITFLAG_RANGE(lo, hi) BR_EVAL(BR_RANGE_GENERATE_I(lo, hi)) BR_MASK_BIT
Section titled “BR_MASK_BIT”#define BR_MASK_BIT(type, idx) source Expansion
#define BR_MASK_BIT(type, idx) (((type) 1) << (idx)) BR_MASK_1
Section titled “BR_MASK_1”#define BR_MASK_1(type, x) source Expansion
#define BR_MASK_1(type, x) BR_MASK_BIT(type, x) BR_MASK_2
Section titled “BR_MASK_2”#define BR_MASK_2(type, x, ...) source Expansion
#define BR_MASK_2(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_1(type, __VA_ARGS__)) BR_MASK_3
Section titled “BR_MASK_3”#define BR_MASK_3(type, x, ...) source Expansion
#define BR_MASK_3(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_2(type, __VA_ARGS__)) BR_MASK_4
Section titled “BR_MASK_4”#define BR_MASK_4(type, x, ...) source Expansion
#define BR_MASK_4(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_3(type, __VA_ARGS__)) BR_MASK_5
Section titled “BR_MASK_5”#define BR_MASK_5(type, x, ...) source Expansion
#define BR_MASK_5(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_4(type, __VA_ARGS__)) BR_MASK_6
Section titled “BR_MASK_6”#define BR_MASK_6(type, x, ...) source Expansion
#define BR_MASK_6(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_5(type, __VA_ARGS__)) BR_MASK_7
Section titled “BR_MASK_7”#define BR_MASK_7(type, x, ...) source Expansion
#define BR_MASK_7(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_6(type, __VA_ARGS__)) BR_MASK_8
Section titled “BR_MASK_8”#define BR_MASK_8(type, x, ...) source Expansion
#define BR_MASK_8(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_7(type, __VA_ARGS__)) BR_MASK_9
Section titled “BR_MASK_9”#define BR_MASK_9(type, x, ...) source Expansion
#define BR_MASK_9(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_8(type, __VA_ARGS__)) BR_MASK_10
Section titled “BR_MASK_10”#define BR_MASK_10(type, x, ...) source Expansion
#define BR_MASK_10(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_9(type, __VA_ARGS__)) BR_MASK_11
Section titled “BR_MASK_11”#define BR_MASK_11(type, x, ...) source Expansion
#define BR_MASK_11(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_10(type, __VA_ARGS__)) BR_MASK_12
Section titled “BR_MASK_12”#define BR_MASK_12(type, x, ...) source Expansion
#define BR_MASK_12(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_11(type, __VA_ARGS__)) BR_MASK_13
Section titled “BR_MASK_13”#define BR_MASK_13(type, x, ...) source Expansion
#define BR_MASK_13(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_12(type, __VA_ARGS__)) BR_MASK_14
Section titled “BR_MASK_14”#define BR_MASK_14(type, x, ...) source Expansion
#define BR_MASK_14(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_13(type, __VA_ARGS__)) BR_MASK_15
Section titled “BR_MASK_15”#define BR_MASK_15(type, x, ...) source Expansion
#define BR_MASK_15(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_14(type, __VA_ARGS__)) BR_MASK_16
Section titled “BR_MASK_16”#define BR_MASK_16(type, x, ...) source Expansion
#define BR_MASK_16(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_15(type, __VA_ARGS__)) BR_MASK_17
Section titled “BR_MASK_17”#define BR_MASK_17(type, x, ...) source Expansion
#define BR_MASK_17(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_16(type, __VA_ARGS__)) BR_MASK_18
Section titled “BR_MASK_18”#define BR_MASK_18(type, x, ...) source Expansion
#define BR_MASK_18(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_17(type, __VA_ARGS__)) BR_MASK_19
Section titled “BR_MASK_19”#define BR_MASK_19(type, x, ...) source Expansion
#define BR_MASK_19(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_18(type, __VA_ARGS__)) BR_MASK_20
Section titled “BR_MASK_20”#define BR_MASK_20(type, x, ...) source Expansion
#define BR_MASK_20(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_19(type, __VA_ARGS__)) BR_MASK_21
Section titled “BR_MASK_21”#define BR_MASK_21(type, x, ...) source Expansion
#define BR_MASK_21(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_20(type, __VA_ARGS__)) BR_MASK_22
Section titled “BR_MASK_22”#define BR_MASK_22(type, x, ...) source Expansion
#define BR_MASK_22(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_21(type, __VA_ARGS__)) BR_MASK_23
Section titled “BR_MASK_23”#define BR_MASK_23(type, x, ...) source Expansion
#define BR_MASK_23(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_22(type, __VA_ARGS__)) BR_MASK_24
Section titled “BR_MASK_24”#define BR_MASK_24(type, x, ...) source Expansion
#define BR_MASK_24(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_23(type, __VA_ARGS__)) BR_MASK_25
Section titled “BR_MASK_25”#define BR_MASK_25(type, x, ...) source Expansion
#define BR_MASK_25(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_24(type, __VA_ARGS__)) BR_MASK_26
Section titled “BR_MASK_26”#define BR_MASK_26(type, x, ...) source Expansion
#define BR_MASK_26(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_25(type, __VA_ARGS__)) BR_MASK_27
Section titled “BR_MASK_27”#define BR_MASK_27(type, x, ...) source Expansion
#define BR_MASK_27(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_26(type, __VA_ARGS__)) BR_MASK_28
Section titled “BR_MASK_28”#define BR_MASK_28(type, x, ...) source Expansion
#define BR_MASK_28(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_27(type, __VA_ARGS__)) BR_MASK_29
Section titled “BR_MASK_29”#define BR_MASK_29(type, x, ...) source Expansion
#define BR_MASK_29(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_28(type, __VA_ARGS__)) BR_MASK_30
Section titled “BR_MASK_30”#define BR_MASK_30(type, x, ...) source Expansion
#define BR_MASK_30(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_29(type, __VA_ARGS__)) BR_MASK_31
Section titled “BR_MASK_31”#define BR_MASK_31(type, x, ...) source Expansion
#define BR_MASK_31(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_30(type, __VA_ARGS__)) BR_MASK_32
Section titled “BR_MASK_32”#define BR_MASK_32(type, x, ...) source Expansion
#define BR_MASK_32(type, x, ...) (BR_MASK_BIT(type, x) | BR_MASK_31(type, __VA_ARGS__)) BR_MAKE_MASK_IMPL
Section titled “BR_MAKE_MASK_IMPL”#define BR_MAKE_MASK_IMPL(type, ...) source Expansion
#define BR_MAKE_MASK_IMPL(type, ...) \
PP_OVERLOAD(BR_MASK, __VA_ARGS__)(type, __VA_ARGS__) BR_MAKE_MASK
Section titled “BR_MAKE_MASK”#define BR_MAKE_MASK(type, ...) source Expansion
#define BR_MAKE_MASK(type, ...) BR_MAKE_MASK_IMPL(type, __VA_ARGS__)