From f55409add2aed591f666d4afeefe756dac9932c0 Mon Sep 17 00:00:00 2001 From: Martijn Laan Date: Thu, 20 Feb 2020 15:26:37 +0100 Subject: [PATCH] Add PS_USECLASSICINVOKE to make it possible to avoid using InvokeCall.inc which was introduced by #207. Alse cleanup the case some of the directives here and make it work on AUTOREFCOUNT. --- Source/uPSRuntime.pas | 52 ++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/Source/uPSRuntime.pas b/Source/uPSRuntime.pas index 18a460b..809ef79 100644 --- a/Source/uPSRuntime.pas +++ b/Source/uPSRuntime.pas @@ -9839,15 +9839,21 @@ begin end; -{$ifndef FPC} +{$IFNDEF FPC} {$UNDEF _INVOKECALL_INC_} - {$IFDEF DELPHI23UP} // DELPHI2010UP == DELPHI14UP - {$IFDEF AUTOREFCOUNT} - {$fatal Pascal Script does not supports compilation with AUTOREFCOUNT at the moment!} - {$ELSE} - {$include InvokeCall.inc} - {$DEFINE _INVOKECALL_INC_} - {$ENDIF} + {$UNDEF USEINVOKECALL} + + {$IFDEF DELPHI23UP} + {$IFNDEF AUTOREFCOUNT} + {$IFNDEF PS_USECLASSICINVOKE} + {$DEFINE USEINVOKECALL} + {$ENDIF} + {$ENDIF} + {$ENDIF} + + {$IFDEF USEINVOKECALL} + {$include InvokeCall.inc} + {$DEFINE _INVOKECALL_INC_} {$ELSE} {$IFDEF Delphi6UP} {$IFDEF CPUX64} @@ -9859,23 +9865,23 @@ end; {$include x86.inc} {$ENDIF} {$ENDIF} -{$else} //fpc includes left unchanged. -{$IFDEF Delphi6UP} - {$if defined(cpu86)} - {$include x86.inc} - {$elseif defined(cpupowerpc)} - {$include powerpc.inc} - {$elseif defined(cpuarm)} - {$include arm.inc} - {$elseif defined(CPUX86_64)} - {$include x64.inc} - {$else} - {$fatal Pascal Script is not supported for your architecture at the moment!} - {$ifend} {$ELSE} - {$include x86.inc} + {$IFDEF Delphi6UP} + {$if defined(cpu86)} + {$include x86.inc} + {$elseif defined(cpupowerpc)} + {$include powerpc.inc} + {$elseif defined(cpuarm)} + {$include arm.inc} + {$elseif defined(CPUX86_64)} + {$include x64.inc} + {$else} + {$fatal Pascal Script is not supported for your architecture at the moment!} + {$ifend} + {$ELSE} + {$include x86.inc} + {$ENDIF} {$ENDIF} -{$endif} type PScriptMethodInfo = ^TScriptMethodInfo;