Dmitry Boyarintsev <skalogryz.li...@gmail.com> schrieb am So., 20. Mai 2018, 04:38:
> On Thu, May 17, 2018 at 5:26 PM, Anthony Walter <sys...@gmail.com> wrote: > >> I am working with some a glib library that expects gboolean to be >> positive 1 for true, yet FPC emits -1 for true. >> > > I'd think that pascal defines true as > true = not false; > In case of unsigned integers "-1" is not an option > FPC defines True as 1 for Boolean, Boolean16, Boolean32 and Boolean64 and as "-1" aka "all bits 1" for Byte Book, WordBool, LongBool and QWordBool. And for unsigned integers "-1" is converted to "all bits 1" as well though one needs to use a typecast (see the declaration of INVALID_HANDLE_VALUE for example). Regards, Sven
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal