Safecall

From Lazarus wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Deutsch (de) English (en)


Back to Reserved words.


The safecall modifier:

  • belongs to the calling conventions of internal and external subroutines;
  • works like the stdcall modifier, with the difference that the register contents are saved and restored.

Example:

function subTest : string; [safecall];
begin
  subTest := 'abc';
end;

Example 2:

...
function funcTest(strTestData : Pchar) : LongWord; safecall; external 'testLibrary.dylib';
...