diff --git a/components/PascalScript/Source/uPSC_dll.pas b/components/PascalScript/Source/uPSC_dll.pas index c467dda0e8..43846f372e 100644 --- a/components/PascalScript/Source/uPSC_dll.pas +++ b/components/PascalScript/Source/uPSC_dll.pas @@ -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; diff --git a/components/PascalScript/Source/uPSComponent.pas b/components/PascalScript/Source/uPSComponent.pas index 43847593eb..8b801d83fb 100644 --- a/components/PascalScript/Source/uPSComponent.pas +++ b/components/PascalScript/Source/uPSComponent.pas @@ -16,6 +16,8 @@ const CdStdCall = uPSRuntime.CdStdCall; + cdVectorCall = uPSRuntime.cdVectorCall; + type TPSScript = class; diff --git a/components/PascalScript/Source/uPSComponentExt.pas b/components/PascalScript/Source/uPSComponentExt.pas index 34beb41776..aa2b472083 100644 --- a/components/PascalScript/Source/uPSComponentExt.pas +++ b/components/PascalScript/Source/uPSComponentExt.pas @@ -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; diff --git a/components/PascalScript/Source/uPSRuntime.pas b/components/PascalScript/Source/uPSRuntime.pas index 72ffa12218..08ad91a0a5 100644 --- a/components/PascalScript/Source/uPSRuntime.pas +++ b/components/PascalScript/Source/uPSRuntime.pas @@ -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; diff --git a/components/PascalScript/Source/uPSUtils.pas b/components/PascalScript/Source/uPSUtils.pas index b4eb164c56..f7346159ca 100644 --- a/components/PascalScript/Source/uPSUtils.pas +++ b/components/PascalScript/Source/uPSUtils.pas @@ -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