Sign in Join
Wiki copytemporary

Safecall: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Safecall

OldNewLine
1+Back to [[Reserved words]].
2+
3+The **safecall** modifier:
4+
5+- belongs to the calling conventions of internal and external subroutines;
6+- works like the [[Stdcall|stdcall]] modifier, with the difference that the register contents are saved and restored.
7+
8+Example:
9+
10+``` pascal
11+function subTest : string; [safecall];
12+begin
13+ subTest := 'abc';
14+end;
15+```
16+
17+Example 2:
18+
19+``` pascal
20+...
21+function funcTest(strTestData : Pchar) : LongWord; safecall; external 'testLibrary.dylib';
22+...
23+```
24+
25+---
26+*From the Free Pascal wiki, page "Safecall", as it stood on 2020-02-26 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history