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

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Jul 22 19:24:26 CEST 2010


On 22 Jul 2010, at 19:05, José Mejuto wrote:

> procedure (a: pointer); cdecl;
> 
> is expected to produce the same effect (not internal implementation)
> in any platform.

Well, no. It is expected to produce the same effect as the C compilers on every platform. These may behave differently amongst different platforms.

> So:
> 
> procedure (const a: record); safecall;
> 
> in Unix will produce a copy of "a" and in Windows a reference to "a"

In Windows it currently only passes "a" by reference if the size of the record is > sizeof(pointer).


Jonas


More information about the fpc-devel mailing list