码迷,mamicode.com
首页 > 其他好文 > 详细

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

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

标签:where   present   type   -o   sig   sign   ons   over   bit   

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.

标签:where   present   type   -o   sig   sign   ons   over   bit   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!