【发布时间】:2025-11-26 13:05:01
【问题描述】:
可能重复:
Is there a clean way to prevent windows.h from creating a near & far macro?
Windef.h 中这两个定义的意义何在?
#define far /* nothing */
#define near /* nothing */
我知道这与 near and far 指针以及它们不再使用的事实有关,但是,#undef 它们是否安全,所以我可以使用 near 和 far 作为函数和变量我的代码中的名称?
或者,我应该避免使用它,并且永远不要使用 near 和 far 作为标识符吗?
【问题讨论】: