discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BOOL typedef in libobjc2


From: Frederik Seiffert
Subject: BOOL typedef in libobjc2
Date: Wed, 17 Nov 2021 18:26:26 +0100

Hi all,

We noticed today that the BOOL type is defined [1] like this in libobjc2:

> #     ifdef STRICT_APPLE_COMPATIBILITY
> typedef signed char BOOL;
> #     else
> #             if defined(__vxworks) || defined(_WIN32)
> typedef  int BOOL;
> #             else
> typedef unsigned char BOOL;
> #             endif
> #     endif
> 


Can anyone explain the reasoning behind the different types for the different 
platforms, and why it’s not just using signed char like on Apple platforms? I’m 
especially wondering about why the int type is used on Windows, as it’s messing 
with some code of ours.

Is there any downside to defining STRICT_APPLE_COMPATIBILITY?

Thanks!
Frederik


[1] 
https://github.com/gnustep/libobjc2/blob/bdf03cb55da14943c8add1c45db7b5a93b656d59/objc/runtime.h#L122-L133


reply via email to

[Prev in Thread] Current Thread [Next in Thread]