[lazarus] About compatibility???

Peter Vreman peter at freepascal.org
Sat Mar 9 09:17:44 EST 2002

> > Personally, I think that h2pas can be extended so it tries to do a
> > better job, and that it should be used to create 'temporary' units
> > which are produced on the fly.
>I don't think that automatic conversion is feasable. Even if it would work
>reasonably for some sources, simple rearrangements (introductions of macro's
>in newer minor versions) could break the Pascal interface, while C would
>keep running.
>It would require awful lot of work, and still would be fragile.
>I think the best thing available is try to speed up conversion time by
>enhancing h2pas with some tweaked codetools edit component, so interactively.
> > The most I can agree with is to add a new keyword 'usesheader' to pascal:
> >
> > uses unitA; UnitB;
> >
> > usesheader libC1,libC2;
>Please no additions! {$useheader xx} then.

Also the {$useheader xx} is something that will never make it into the 
compiler. We are a pascal compiler not a C compiler. You always need to do 
some manual adaption after translating C header files. Especially the 
macro's need to be translated into usefull function. Simply skipping 
macro's is not an option.

There is a preprocessor for h2pas called h2paspp. It preprocesses the files 
simply using #ifdef etc. I've tried in the past using cpp but that didn't 
work because it removed to much information that is required for 
translating the header.

IMHO an option for h2pas in the IDE is not that usefull, it can only be 
used for very simple .h files not for complex things like gtk/gnome.


More information about the Lazarus mailing list