![]() Must be in parentheses this is required to enable providing a comma as separator. comma or semicolon) placed after each invocation of F. FOO expands to nothing)į: Macro to invoke on each nonempty element of the variable arguments Rewriting SQUARE so it reacts appropriately when “x” is empty (which would be necessary if e.g. ![]() ![]() Struct foo įiguring out whether the FOO, BAR, and BAZ expansions are empty and adding a comma manually (or not) between FOR_EACH() calls Get a pointer to a container structure from an element. if ptr and array are mixed up).ġ if ptr is part of array, 0 otherwise Parameters In C but not C++, this causes a compile error if array is not an array (e.g. PART_OF_ARRAY ( array, ptr ) ¶Ĭheck if a pointer ptr lies within array. In C, passing a pointer as array causes a compile error. The results may not be particulary meaningful in this case. In C++, due to language limitations, this will accept as array any type that implements operator. This macro is available only from C, not C++. Zero if array has an array type, a compile error otherwise. ![]() ZERO_OR_COMPILE_ERROR ( cond ) ¶Ġ if cond is true-ish causes a compile error otherwise. GENMASK ( h, l ) ¶Ĭreate a contiguous bitmask starting at bit position l and ending at position h. INT_TO_POINTER ( x ) ¶Ĭast x, a signed integer, to a void*. POINTER_TO_INT ( x ) ¶Ĭast x, a pointer, to a signed integer. UINT_TO_POINTER ( x ) ¶Ĭast x, an unsigned integer, to a void*. Cast x, a pointer, to an unsigned integer.
0 Comments
Leave a Reply. |