是否可以使用常规文本加入宏定义?
例如;
#define T_NAME Text_Int
#define MAP_KEYS T_NAME _Map_Keys // defined in a separate header file "a.h"
// I am hoping MAP_KEYS = Text_Int_Map_Keys
Run Code Online (Sandbox Code Playgroud)
所以我可以去:
#undef T_NAME
#undef MAP_KEYS
#define T_NAME Text_Real
#define MAP_KEYS T_NAME _Map_Keys
#undef T_NAME
#undef MAP_KEYS
#define T_NAME Text_Short
#define MAP_KEYS T_NAME _Map_Keys
Run Code Online (Sandbox Code Playgroud)