Safecall

From Lazarus wiki
Revision as of 09:54, 26 February 2020 by Trev (talk | contribs) (Fixed typos)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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';
...