[fpc-devel] Safecall on Linux (and other unices?)

Joost van der Sluis joost at cnoc.nl
Wed Jul 21 14:00:45 CEST 2010


On Wed, 2010-07-21 at 19:32 +0800, Paul Ishenin wrote:
> 21.07.2010 18:57, Michael Van Canneyt wrote:
> > The problem is that then all XPCom headers must be translated
> >
> > Procedure SomeMethod; {$ifdef windows}safecall{$else}newsafecall {$endif}
> We have a special macros as I remember for this purposes.
> >
> > Which is a serious pain. I'd prefer then to let safecall be 
> > cdecl+exception handling, and in the event that Embarcadero - again - 
> > chooses the wrong way, to have a directive:
> >
> > {$SAFECALLCALLING CDECL}
> >
> > We have the same for COM/CORBA interfaces, after all.
> >
> > I think that Linux is FPC territory, it has been for 15 years, and 
> > here we should make the rules when on new ground. In this case that 
> > means preferring the GCC/G++ way instead of some hypothetical or 
> > already proven dead Embarcadero product. In short, it is the logical 
> > and obvious choice.
> I don't insist on another calling convention (and moreover in real I 
> don't want to have more calling conventions). I'm just trying to show 
> another point of view to find the optimal solution.

I'll try to patch the compiler so that safecall behaves like cdecl
+exceptions on Linux. 

If we need more changes later on, or changes for Delphi X compatibility
we can add that later. As Marco said, 2.5.1 won't become stable soon so
the result is not immediately carved in stone. 

Joost.





More information about the fpc-devel mailing list