cppmagic: Logical operations
In order to implement fancier things, we need to represent truth values in
cpp. We use '0' and '1' strings, like in C, but we need ways to get these
values from other conditions.
CPPMAGIC_ISZERO() and CPPMAGIC_NONZERO() test if the argument is '0' or
anything else (ISZERO doubles as a logical not).
CPPMAGIC_ISEMPTY() and CPPMAGIC_NON_EMPTY() expand to 0 or 1 depending on
whether they have any arguments at all or not.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Showing
Please register or sign in to comment