[fpc-devel] Re. z370 Cross Compilation, Pass 2 of ....
DrDiettrich1 at aol.com
Sat Aug 24 21:40:15 CEST 2013
> > > If we use gas/ld we put ourselves in the same situation Delphi landed
> > > us in with the use of non-standard libraries; Writing individual
> > > wrapper functions for every other function under the sun.
> > Would you elaborate what you mean here?
> Sorry, isn't this a universal problem, or is it just me? Anyway.. If I am
> writing code in Delphi and I want to use, say, MySQL; I have a problem;
> Delphi provides no mechanism to call MySQL. If I am a C programmer, I just
> include the .h file and MySQL is available.
This is not really true. I have an C-to-Pascal translator, that
translates the header files perfectly. Well, some constructs (with
unions) cannot be translated as they are declared, but these are rare
and do not affect API calls, only subsequent access to the struct fields.
But that translator requires the right header files of the compiler,
used to translate the library, compiler settings etc. If you didn't
compile the library on your system, even a C compiler may fail to
properly connect to the library ABI. This is not a big problem on
systems with only one C compiler and library, but how many C compilers
exist for Windows? Even worse with C++, where no compiler produces
binaries usable with a different C++ compiler.
In fact my translator can convert C code of many compilers into OPL,
where some compilers require very special translation. But configuring
it is so complicated, that only few people ever used it. Most are happy
with h2pas or similar tools, which only deal with header files and can
produce unusable results in certain cases. You have the choice...
More information about the fpc-devel