Essentially I got four cases in existing code:
- macro ABC is unset
- macro ABC is set, but empty:
#define ABC
or-DABC
- macro ABC is set, and evaluates to true:
#define ABC 1
or-DABC=1
- macro ABC is set, and evaluates to false:
#define ABC 0
or-DABC=0
I want the 1st and 4th, and 2nd and 3rd case to be the same:
#if defined(ABC) && IS_EMPTY(ABC)
# undef ABC
# define ABC 1
#endif
#if !defined(ABC) || !(ABC)
# undef ABC
# define ABC 0
#endif
How do I do IS_EMPTY(X)
?