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

Dmitry Boyarintsev skalogryz.lists at gmail.com
Sat Oct 13 15:55:08 CEST 2018


On Sat, Oct 13, 2018 at 3:08 AM Michael Van Canneyt <michael at freepascal.org>
wrote:

>
> Because introducing a type in a language and naming it after some library
> is
> not done. objcbool at least refers to another language.
>

ObjC language doesn't have its own boolean type.
It's either C "_Bool" for ARM, or "a signed char" for Intel/PPC, with 1 for
TRUE and 0 for FALSE.

So, in sources we could declare objcbool as such:
type
  objcbool = {IFDEF ARM}Boolean{$ELSE}Bool???{$ENDIF};

Bool??? - what type?
ByteBool - doesn't fit, because it's true value is not false ($FF)
Boolean - doesn't fit, because it's _Bool type (and that makes difference
for 64-bit, because passing parameters is different)
Boolean8 - doesn't fit, because it's just and alias to Boolean.
ShortInt or Byte - obviously don't fit, because they cannot accept boolean
values.

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


More information about the fpc-devel mailing list