[fpc-pascal] LongBool True = -1

Sven Barth pascaldragon at googlemail.com
Sun May 20 03:33:22 CEST 2018


Gerhard Scholz <gs at g--s.de> schrieb am Sa., 19. Mai 2018, 19:51:

> Afaik, the bool types (longbool, wordbool, bytebool) come from the C
> language and are mostly used to interface with C libraries (for example:
> windows). The definitions there are: 0 means FALSE, anything else means
> TRUE. Normally C routines return a dword/word/byte filled with ones for
> TRUE
> and expect something not 0 as TRUE. So, the definition comes from C. As
> long
> Pascal programmers want to use libraries written in C, this definition
> should not be changed in the Pascal compiler.
>

For glib that is not true. See my quote from their documentation. Also that
library is the main reason that the Boolean32 type exists (Boolean16 and
Boolean64 were logical extensions then).

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180520/474f74cf/attachment.html>


More information about the fpc-pascal mailing list