【发布时间】:2014-05-06 19:15:44
【问题描述】:
我注意到 UInt32 的定义根据MacTypes.h 中的平台不同
#if __LP64__
typedef unsigned int UInt32;
typedef signed int SInt32;
#else
typedef unsigned long UInt32;
typedef signed long SInt32;
#endif
如果unsigned int 在 32 位和 64 位机器上总是 32 位,他们为什么还要有条件地检查平台?
【问题讨论】:
-
类似问题:
NSInteger在 32 位模式下是int,在 64 位模式下是long。如果 Apple 通常将NSInteger定义为long,那么我们就不必为每个 printf 语句添加强制转换。 -
或许
else案例也支持16位系统int
标签: c macos-carbon