当用define预定义一个函数后undef时在X86平台下不能加参数,否则将报"extra tokens at end of #undef directive"的错误。测试过。
eg:
#define RECORD_INSTRUCTION(opcode_str,cond) printf("The opcode is : %s, condition is : %d \n", opcode_str, cond)
#undef RECORD_INSTRUCTION(opcode_str,cond)会报错
#undef RECORD_INSTRUCTION正确。
本文探讨了在X86平台上使用预处理器指令define定义宏,并在后续代码中使用#undef取消定义宏时的注意事项。特别指出,在取消定义宏时不能携带参数,否则会导致编译错误。
1012

被折叠的 条评论
为什么被折叠?



