I would like something like:
#define C_OR_CPP(C__, CPP__) #ifdef __cplusplus\\
CPP__\\
#else\\
C__\\
#endif
Is it possible? Maybe some dirt
AProgrammer already given you the right answer, but the answer to the "is it possible" part of the question is no. Macro expansion doesn't occur until after all preprocessor directives have been handled, so any macro that expands into a #define
or #ifdef
will be passed to the compiler as regular source text, which will cause the compiler to yak.