16#ifndef CCC_IMPL_BITSET
17#define CCC_IMPL_BITSET
49 CCC_IMPL_BS_BLOCK_BITS = (
sizeof(*(
struct ccc_bitset){}.blocks) * CHAR_BIT),
54#define ccc_impl_bs_block_count(impl_bit_cap) \
55 (((impl_bit_cap) + (CCC_IMPL_BS_BLOCK_BITS - 1)) / CCC_IMPL_BS_BLOCK_BITS)
58#define ccc_impl_bs_block_bytes(impl_bit_cap) \
59 (sizeof(*(struct ccc_bitset){}.blocks) * (impl_bit_cap))
64#define ccc_impl_bs_blocks(impl_bit_cap, ...) \
65 (__VA_OPT__(__VA_ARGS__) typeof ( \
66 *(struct ccc_bitset){}.blocks)[ccc_impl_bs_block_count(impl_bit_cap)]) \
70#define IMPL_BS_NON_IMPL_BS_DEFAULT_SIZE(impl_cap, ...) __VA_ARGS__
72#define IMPL_BS_DEFAULT_SIZE(impl_cap, ...) impl_cap
74#define IMPL_BS_OPTIONAL_SIZE(impl_cap, ...) \
75 __VA_OPT__(IMPL_BS_NON_)##IMPL_BS_DEFAULT_SIZE(impl_cap, __VA_ARGS__)
81#define ccc_impl_bs_init(impl_bitblock_ptr, impl_alloc_fn, impl_aux, impl_cap, \
84 .blocks = (impl_bitblock_ptr), \
85 .count = IMPL_BS_OPTIONAL_SIZE((impl_cap), __VA_ARGS__), \
86 .capacity = (impl_cap), \
87 .alloc = (impl_alloc_fn), \
struct ccc_bitset ccc_bitset
The bit set type that may be stored and initialized on the stack, heap, or data segment at compile or...
Definition: bitset.h:73
void * ccc_any_alloc_fn(void *ptr, size_t size, void *aux)
An allocation function at the core of all containers.
Definition: types.h:312