Difference between revisions of "Safecall"
From Lazarus wiki
Jump to navigationJump to searchm (Fixed typo) |
m (Fixed typos) |
||
Line 1: | Line 1: | ||
− | {{ | + | {{safecall}} |
Line 13: | Line 13: | ||
<syntaxhighlight lang=pascal> | <syntaxhighlight lang=pascal> | ||
− | function subTest : string; [ | + | function subTest : string; [safecall]; |
begin | begin | ||
subTest := 'abc'; | subTest := 'abc'; | ||
Line 23: | Line 23: | ||
<syntaxhighlight lang=pascal> | <syntaxhighlight lang=pascal> | ||
... | ... | ||
− | function funcTest(strTestData : Pchar) : LongWord; | + | function funcTest(strTestData : Pchar) : LongWord; safecall; external 'testLibrary.dylib'; |
... | ... | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 09:54, 26 February 2020
│
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';
...