【发布时间】:2016-04-08 14:04:13
【问题描述】:
所以我的 Visual Studio 将 tag1 和 tag2 都声明为未定义,但它们已明确定义,我不能根据另一个定义一个吗?
#define push 99
#define last_instruction push
#ifdef DEBUG
#define new_instr (1+last_instruction) //should be 100
#undef last_instruction
#define last_instruction new_instr //redifine to 100 if debug
#endif
我有一些关于 tag2 的案例,它说定义必须是 const,但它是恒定的,它是 1+99,任何帮助将不胜感激。
谢谢! 巴
【问题讨论】:
-
您应该尝试启用“生成预处理文件”选项 (/P) 以查看发生了什么。
-
也许
__COUNTER__会帮助你。
标签: c c-preprocessor