[Lazarus] GeckoPort, Free Pascal only?

Joost van der Sluis joost at cnoc.nl
Mon Oct 11 11:36:00 CEST 2010


On Mon, 2010-10-11 at 07:21 +0800, Paul Ishenin wrote:
> 10.10.2010 22:07, Joost van der Sluis wrote:
> > But GeckoPort has to be patched also. But with the new xpcom-support on
> > non-Windows systems, we have to add tons of ifdef's is we want to keep
> > the code compilable on Delphi. Is that a requirement or can we drop the
> > support for Delphi-compilation?
> What is the difference between delphi and fpc for xpcom?

Main thing is that Delphi is Windows-only, so it doesn't have features
to handle xpcom on non-Windows.

1:
xpcom uses cdecl as default calling convention. Delphi uses stdcall (In
IInterface and safecall). To be com-compatible xpcom also uses stdcall
on Windows, that's why it works. ;)

2:
The translated headers we use (Geckoport) assume that const-parameters
are always passed by reference if the parameter is a record with a
size>ptrsize. This is not always the case. (Well, on Windows/stdcall it
is. So that's why it works on Delphi.)

This leads to {$ifdef}'s around every 'stdcall' identifier. (If we use
fpc-code only, that can be done using a macro) And to solve problem 2,
fpc now has the 'constref' parameter type. This has to be surrounded by
{$ifdef}'s too.

Joost






More information about the Lazarus mailing list