Q: Can I use an #ifdef in a #define line, to define something two different ways, like this?
#define a b \ #ifdef whatever c d #else e f g #endif
A: No. You can't ``run the preprocessor on itself,'' so to speak. What you can do is use one of two completely separate #define lines, depending on the #ifdef setting:
#ifdef whatever #define a b c d #else #define a b e f g #endif
References:
ISO Sec. 6.8.3, Sec. 6.8.3.4
H&S Sec. 3.2 pp. 40-1