[fpc-devel] OSX: Setting up parameters to objc_msgSend()

Dmitry Boyarintsev skalogryz.lists at gmail.com
Fri Oct 12 15:17:30 CEST 2018


On Fri, Oct 12, 2018 at 1:51 AM Sven Barth via fpc-devel <
fpc-devel at lists.freepascal.org> wrote:

> Dmitry Boyarintsev <skalogryz.lists at gmail.com> schrieb am Fr., 12. Okt.
> 2018, 02:07:
>
>> On Thu, Oct 11, 2018 at 4:16 PM Jonas Maebe <jonas at freepascal.org> wrote:
>>
>>> However, the Objective-C BOOL type does not map to _Bool on x86-64, but
>>> to signed char. And values of that type indeed do need to (sign)
>>> extended.
>>>
>>
>> Should use of ByteBool resolve the problems for ObjC mapped headers for
>> the current version of the compiler?
>> is "ByteBool" an alias for Boolean, or is it forcefully "char" sized for
>> x86_64 ABI?
>>
>
> Even Boolean has the correct size of 1 Byte. The difference is the value
> of True: For Boolean its always 1, for ByteBool it's "not 0".
>

But it feels like "signed chars" are treated differently, where the value
would extended to the remaining bits of the register.
That's why I was wondering if "ByteBool" would be passed differently than
"Boolean" on 64-bit.

Here's a similar discussion
https://stackoverflow.com/questions/31267325/bool-with-64-bit-on-ios

It actually states that true _Bool is only used for 64-bit ARM and no other
targets.

So, I'm wondering if it's actually a compiler issue or headers issue.
and can ByteBool be used as a substitute for signed char.

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20181012/45e43031/attachment.html>


More information about the fpc-devel mailing list