[fpc-pascal] Porting discussion
RainerStratmann at t-online.de
Wed Dec 10 12:58:09 CET 2008
Am Montag, 8. Dezember 2008 10:50 schrieb Marco van de Voort:
> In our previous episode, Rainer Stratmann said:
> > To increaase compatibility to Linux it would be great if it is possible
> > to create a keyword which it makes possible to include C-headers and then
> > do automatically the binding stuff.
> > That means that fpc woul be able to parse C-code (headers).
> > If that is possible.
> Not, or at least not enough to be robust. A lot of C headers is based on
> (macro,define) substitution, IOW it needs context of use to obtain the full
> This is also why the header conversion tool only works to a certain degree.
> If headers are reasonably clean it can work ok. If you have hundreds of
> macros and special constructs it needs manual work. (for which I can't
> imagine a solution, even in theory).
May it would be a solution if the C-compiler which compiles the library
generates a 'generic library interface file' or something similar with all
necessary information. Because the compiler has all the information.
From this 'generic library interface file' it will be easier to convert a
pascal header interface file. Or the C-compiler generates it directly for
pascal. ---> 'pascal library interface file' or similar...
That I can imagine could be a solution, but the C-compiler programmers have to
implement this function.
The full meaning-context can be read in the original C-header file then.
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal