我知道,这bool
是在 C++ 中使用的,而BOOL
它是 Microsoft 特定的类型,被定义为int
.
我的代码正在使用BOOL
,因为它是为 Windows 开始的,但是BOOL
当我将它移植到 Mac 时,我试图在不将代码从 bool 更改为 bool 的情况下保持相同的方式。
像这样的东西可以吗?
typedef int8_t _Bool;
typedef _Bool (BOOL);
static const BOOL False = 0;
static const BOOL True = 1;
如果是,有没有更好的方法,为什么?
如果不是,那么为什么以及我应该怎么做?