Difference between revisions of "Safecall"

From Free Pascal wiki
Jump to navigationJump to search
(English translation of German page)
 
m (Fixed typo)
Line 5: Line 5:
  
  
The '''savecall''' modifier:
+
The '''safecall''' modifier:
  
 
* belongs to the calling conventions of internal and external subroutines;
 
* belongs to the calling conventions of internal and external subroutines;

Revision as of 09:50, 26 February 2020

Template:savecall


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; [savecall];
begin
  subTest := 'abc';
end;

Example 2:

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