[fpc-pascal] LongBool True = -1

Sven Barth pascaldragon at googlemail.com
Fri May 18 07:22:16 CEST 2018


Am 17.05.2018 um 23:26 schrieb Anthony Walter:
> I am working with some a glib library that expects gboolean to be 
> positive 1 for true, yet FPC emits -1 for true. Is there a compiler 
> flag to force boolean types to emit 1 instead of -1? If so, would 
> there possibly be any side effects with other pascal code?
Why don't you use the glib2 unit which declares a correct gBoolean type 
(using Boolean32 which had been introduced for that purpose) and 
accordingly defined gTRUE and gFALSE?

Regards,
Sven



More information about the fpc-pascal mailing list