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

2017-08-26 Thread noreply
On 2017-08-26 17:09, mar...@stack.nl wrote: In our previous episode, nore...@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

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

2017-08-26 Thread noreply
On 2017-08-26 17:22, mar...@stack.nl wrote: In our previous episode, Michael Van Canneyt said: I think the programmer *must* worry about the details and must definitely NOT use the booleans for anything C related. That was my point. The interface uses bool, either as param or in a structure.

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

2017-08-26 Thread noreply
On 2017-08-26 02:50, Michael Van Canneyt wrote: I thought all this BOOL mess was just meant to be able to interface with C libs slightly easier. But, why is the BOOL in fpc/delphi not compatible with C BOOL, in that it has different semantics? One value lines up correct... but not always th

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

2017-08-26 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: > I think the programmer *must* worry about the details and must definitely > NOT use the booleans for anything C related. That was my point. The interface uses bool, either as param or in a structure. So what can you do? > Attempting to cater f

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

2017-08-26 Thread Marco van de Voort
In our previous episode, nore...@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 programmin

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

2017-08-26 Thread Sven Barth via fpc-pascal
On 26.08.2017 13:43, Michael Van Canneyt wrote: > > > 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. >>> >>> A

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

2017-08-26 Thread Michael Van Canneyt
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

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

2017-08-26 Thread Sven Barth via fpc-pascal
On 26.08.2017 12:57, Michael Van Canneyt wrote: > > > On Sat, 26 Aug 2017, Sven Barth wrote: > >>> >>> Sorry for being naive. Why not simply use a boolean ? >>> >>> I thought all this BOOL mess was just meant to be able to interface >>> with C >>> libs slightly easier. >>> >>> Instead of >>> >>>

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

2017-08-26 Thread Michael Van Canneyt
On Sat, 26 Aug 2017, Sven Barth wrote: Sorry for being naive. Why not simply use a boolean ? I thought all this BOOL mess was just meant to be able to interface with C libs slightly easier. Instead of If (SomeCfunction()<>0) then DoSomethingStupid; it allows you to write - in appropriat

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

2017-08-26 Thread Sven Barth via fpc-pascal
Am 26.08.2017 09:50 schrieb "Michael Van Canneyt" : > > > > On Sat, 26 Aug 2017, Sven Barth via fpc-pascal wrote: > >> Am 26.08.2017 07:25 schrieb : >>> >>> >>> What about the BOOL issue.. >>> >>> We know that Boolean in fpc/delphi is not compatible with a C bool >>> >>> But it gets worse than that

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

2017-08-26 Thread Michael Van Canneyt
On Sat, 26 Aug 2017, Sven Barth via fpc-pascal wrote: Am 26.08.2017 07:25 schrieb : What about the BOOL issue.. We know that Boolean in fpc/delphi is not compatible with a C bool But it gets worse than that: even fpc/delphi's bool is not always compatible (but is sometimes). For example

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

2017-08-26 Thread Sven Barth via fpc-pascal
Am 26.08.2017 07:25 schrieb : > > What about the BOOL issue.. > > We know that Boolean in fpc/delphi is not compatible with a C bool > > 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-bo