[fpc-devel] Safecall on Linux (and other unices?)
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Wed Jul 21 16:36:01 CEST 2010
José Mejuto schrieb:
> It is not 100% cdecl, const records in safecall must be passed as
> reference while in cdecl a copy of the record is being passed.
Copies IMO make no sense here, when "const" protects the record elements
from any modifications. That's why a compiler should be free to pass
short consts by value, and larger ones (exceeding sizeof(pointer)) by
reference.
But of course the definition of the systemwide cdecl and safecall
conventions must be observed. When no such definition exists for
safecall on a platform, every compiler can define it differently,
preventing the use of such procedures in external code (.so).
DoDi
More information about the fpc-devel
mailing list