C/C++ #define宏内宏?

ima*_*ake 6 c c++ c-preprocessor

我想要像:

#define C_OR_CPP(C__, CPP__) #ifdef __cplusplus\
CPP__\
#else\
C__\
#endif
Run Code Online (Sandbox Code Playgroud)

可能吗?也许#include有些肮脏的黑客?

原因:我创建了一个结构使用类型成员变量的标题vector<stuff>*,但是在C中我希望​​它只是void*,你知道.

TIA

APr*_*mer 11

有什么问题

#ifdef __cplusplus
#define C_OR_CPP(C, CPP) CPP
#else
#define C_OR_CPP(C, CPP) C
#endif
Run Code Online (Sandbox Code Playgroud)

(将双下划线的名称留给每个菲涅耳评论的实现)