Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-10

GeckoPort, Free Pascal only?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joost van der Sluis

Hi Joshy/all,

To make Gecko wotk the necessary safecall support for Free Pascal on linux/i386 is now available in fpc-trunk. The additional IInterface changes are in the xpcom branch and will eventually be merged to trunk.

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?

Joost.

Reply by email

Paul Ishenin
to Joost van der Sluis
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?

Best regards,
Paul Ishenin.

Reply by email

Joost van der Sluis
to Paul Ishenin
Paul Ishenin wrote 6 lines
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

Reply by email