[fpc-pascal] H2pas tool vs others, C header translation

noreply at z505.com noreply at z505.com
Sun Aug 27 08:43:37 CEST 2017


On 2017-08-26 17:09, marcov at stack.nl wrote:
> In our previous episode, noreply at z505.com said:
>> But it gets worse than that: even fpc/delphi's bool is not always
>> compatible (but is sometimes).
>> 
>> For example:
>> http://blog.delphi-jedi.net/2008/09/25/bool-boolean-and-integer/
>> 
>> When one must use Integers to do boolean related programming tasks, it
>> makes me want to quit programming ;)
> 
> The QueryServiceConfig2 is a known exception in WINAPI land that in 
> some
> cases assumes things about what is TRUE.
> 
> The GTK headers also use a 0/1 boolean, and for that the boolean8/16/32
> types were created. I couldn't quickly find docs, so I filed a bug for 
> that.
> 
> IOW that problem has long resolved, you just need to know what 
> convention
> the C code uses, and map that then to either boolean32 or longbool (or 
> rarer
> cases)

That's good news, does Delphi need to add a boolean8/16/32 some day, or 
already has?

As I often switch between using fpc and delphi all the time, almost 
50/50



More information about the fpc-pascal mailing list