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

Michael Van Canneyt michael at freepascal.org
Sat Aug 26 13:43:39 CEST 2017



On Sat, 26 Aug 2017, Sven Barth via fpc-pascal wrote:

>> 
>> I did read it.
>> 
>> I think the programmer *must* worry about the details and must definitely
>> NOT use the booleans for anything C related. That was my point.
>> 
>> Attempting to cater for C code using BOOL or whatever type is misplaced.
>> C does not have a boolean type.
>> 
>> The standard says for "if" :
>> 
>> "In both forms, the first substatement is executed if the expression
>> compares unequal to 0."
>> 
>> Treat it as such.
>
> And I say that the programmer does not need to care about it if the one
> that translated the interface used the correct type.

And this "if" is the cliff on which the ship crashes and sinks...

> Please also note that I'm only talking about cases where there is indeed
> a definition of a boolean type on the C side of things (e.g. the Windows
> API with its BOOL as well as TRUE and FALSE definitions and GTK for
> which the Boolean16, -32 and -64 types were introduced).

I understood it like that.

Michael.



More information about the fpc-pascal mailing list