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

Marco van de Voort marcov at stack.nl
Sun Aug 27 00:09:59 CEST 2017


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)




More information about the fpc-pascal mailing list