首页 > 其他 > 详细

For 32-bit BOOL is a signed char, whereas under 64-bit it is a bool.

时间:2017-06-20 12:01:06      阅读:170      评论:0      收藏:0      [点我收藏+]

https://stackoverflow.com/questions/31267325/bool-with-64-bit-on-ios/31270249#31270249

Definition of BOOL from objc.h:

/// Type to represent a boolean value.
#if (TARGET_OS_IPHONE && __LP64__)  ||  TARGET_OS_WATCH
#define OBJC_BOOL_IS_BOOL 1
typedef bool BOOL;
#else
#define OBJC_BOOL_IS_CHAR 1
typedef signed char BOOL; 
// BOOL is explicitly signed so @encode(BOOL) == "c" rather than "C" 
// even if -funsigned-char is used.
#endif

For 32-bit BOOL is a signed char, whereas under 64-bit it is a bool.

原文:http://www.cnblogs.com/feng9exe/p/7053490.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!