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

noreply at z505.com noreply at z505.com
Tue Aug 22 12:21:27 CEST 2017


On 2017-08-21 13:08, marcov at stack.nl wrote:
> In our previous episode, Michael Van Canneyt said:
>> > I am looking to convert the GNU MPFR library header files, or hire
>> > someone on a bounty to do it if header translation is not so easy with
>> > h2pas and requires lots of hand work, and close checking.
>> 
>> I do all header translations with h2pas. Most of the time, I run the 
>> code
>> first through gcc -E, which will take care of all macro magic. Usually 
>> h2pas
>> has little trouble with the result.
> 
> Before everything I do a couple of substs with an editor,


What do you mean by substs..

Search/replace, (substitutions? regex?)

> gcc -E I use small pascal filterprograms to sort the symbols based on
> heuristics.  Usually "clean" defines, structs, function calls and 
> "rest".

A custom filter program for each case by case basis, or one major filter 
program you wrote for all header files?

Thanks for the tips.



More information about the fpc-pascal mailing list