#include <petscmacros.h> int PetscCompl(b)
b | - Preprocessor variable, must expand to either integer literal 0 or 1 |
<return | - value> - Either integer literal 0 or 1 |
Expands to integer literal 0 if b expands to 1, or integer literal 1 if b expands to 0. Behaviour is undefined if b expands to anything else. PetscCompl() will expand its argument before returning the complement.
This macro can be useful for negating PetscDefined() inside macros e.g.
#define PETSC_DONT_HAVE_FOO PetscCompl(PetscDefined(HAVE_FOO))
#define MY_VAR 1 PetscCompl(MY_VAR) -> 0 #undef MY_VAR #define MY_VAR 0 PetscCompl(MY_VAR) -> 1