抱歉标题令人困惑,但我想不出一个可以清楚地描述我的问题的标题。在编写 C 或 C++ 程序时,通常可以将 char 与 CHAR 或 int 与 INT 或 void 与 VOID 等关键字联系起来。
在 winnt.h 中,它们的定义如下:
#ifndef VOID
#define VOID void
typedef char CHAR;
typedef short SHORT;
typedef long LONG;
#if !defined(MIDL_PASS)
typedef int INT;
#endif
#endif
这样做有什么用?是满足约定还是保证兼容性?