mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 03:59:17 +02:00
pascalscript: added proc modifier vectorcall, patch #33134
git-svn-id: trunk@57289 -
This commit is contained in:
parent
43543a0cbb
commit
488478cd6e
@ -30,6 +30,7 @@ type
|
||||
, clPascal
|
||||
, ClCdecl
|
||||
, ClStdCall
|
||||
, clVectorCall
|
||||
);
|
||||
|
||||
var
|
||||
@ -125,6 +126,7 @@ begin
|
||||
if FuncCC = 'CDECL' then cc := ClCdecl else
|
||||
if FuncCC = 'REGISTER' then cc := clRegister else
|
||||
if FuncCC = 'PASCAL' then cc := clPascal else
|
||||
if FuncCC = 'VECTORCALL' then cc := clVectorCall else
|
||||
begin
|
||||
Sender.MakeError('', ecCustomError, tbtstring(RPS_InvalidCallingConvention));
|
||||
Result := nil;
|
||||
|
@ -16,6 +16,8 @@ const
|
||||
|
||||
CdStdCall = uPSRuntime.CdStdCall;
|
||||
|
||||
cdVectorCall = uPSRuntime.cdVectorCall;
|
||||
|
||||
type
|
||||
TPSScript = class;
|
||||
|
||||
|
@ -23,6 +23,8 @@ const
|
||||
{alias to @link(ifps3.cdStdcall)}
|
||||
CdStdCall = uPSRuntime.CdStdCall;
|
||||
|
||||
cdVectorCall = uPSRuntime.cdVectorCall;
|
||||
|
||||
type
|
||||
{Alias to @link(ifps3.TPSCallingConvention)}
|
||||
TDelphiCallingConvention = uPSRuntime.TPSCallingConvention;
|
||||
|
@ -1080,6 +1080,8 @@ const
|
||||
|
||||
cdStdCall = uPSUtils.cdStdCall;
|
||||
|
||||
cdVectorCall = uPSUtils.cdVectorCall;
|
||||
|
||||
InvalidVal = Cardinal(-1);
|
||||
|
||||
function PSDynArrayGetLength(arr: Pointer; aType: TPSTypeRec): Longint;
|
||||
@ -11996,6 +11998,10 @@ function DelphiFunctionProc_Safecall(Caller: TPSExec; p: TPSExternalProcRec; Glo
|
||||
begin
|
||||
Result := DelphiFunctionProc(Caller, p, Global, Stack, cdSafeCall);
|
||||
end;
|
||||
function DelphiFunctionProc_Vectorcall(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSStack): Boolean;
|
||||
begin
|
||||
Result := DelphiFunctionProc(Caller, p, Global, Stack, cdVectorCall);
|
||||
end;
|
||||
|
||||
procedure TPSExec.RegisterDelphiFunction(ProcPtr: Pointer;
|
||||
const Name: tbtString; CC: TPSCallingConvention);
|
||||
@ -12012,6 +12018,7 @@ begin
|
||||
cdStdCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Stdcall, ProcPtr, Slf);
|
||||
cdSafeCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Safecall, ProcPtr, Slf);
|
||||
cdCdecl: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_CDECL, ProcPtr, Slf);
|
||||
cdVectorCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Vectorcall, ProcPtr, Slf);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -323,7 +323,7 @@ type
|
||||
{$ELSE}
|
||||
{$IFDEF CPU64} IPointer = LongWord;{$ELSE} IPointer = Cardinal;{$ENDIF}{$ENDIF}
|
||||
{$ENDIF}
|
||||
TPSCallingConvention = (cdRegister, cdPascal, cdCdecl, cdStdCall, cdSafeCall);
|
||||
TPSCallingConvention = (cdRegister, cdPascal, cdCdecl, cdStdCall, cdSafeCall, cdVectorCall);
|
||||
|
||||
|
||||
const
|
||||
|
Loading…
Reference in New Issue
Block a user