我知道 sizeof 是一个运算符,它在编译时被评估为一个整数常量。但它似乎不能在 #if 预处理器指令中使用,例如:
#if 4 == sizeof(int)
typedef int Int32;
#endif
(cygwin-gcc 3.4.4 以及 Visual C++ 6.0 报告编译错误)
为什么不允许这样的使用?
我知道 sizeof 是一个运算符,它在编译时被评估为一个整数常量。但它似乎不能在 #if 预处理器指令中使用,例如:
#if 4 == sizeof(int)
typedef int Int32;
#endif
(cygwin-gcc 3.4.4 以及 Visual C++ 6.0 报告编译错误)
为什么不允许这样的使用?