PascalScript: Revert rev 76e377efa5fddc55b3a6a3a3d944317bdfde4a12. Fix compile for linux

git-svn-id: trunk@60720 -
This commit is contained in:
martin 2019-03-19 01:07:24 +00:00
parent 016a724523
commit fac4d989d7

View File

@ -10,7 +10,6 @@ procedure RegisterDLLRuntimeEx(Caller: TPSExec; AddDllProcImport, RegisterUnload
function ProcessDllImport(Caller: TPSExec; P: TPSExternalProcRec): Boolean;
function ProcessDllImportEx(Caller: TPSExec; P: TPSExternalProcRec; ForceDelayLoad: Boolean): Boolean;
function ProcessDllImportEx2(Caller: TPSExec; P: TPSExternalProcRec; ForceDelayLoad: Boolean; var DelayLoad: Boolean; var ErrorCode: LongInt): Boolean;
procedure UnloadDLL(Caller: TPSExec; const sname: tbtstring);
function UnloadProc(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSStack): Boolean;
@ -74,7 +73,7 @@ begin
Dispose(p);
end;
function LoadDll(Caller: TPSExec; P: TPSExternalProcRec; var ErrorCode: LongInt): Boolean;
function LoadDll(Caller: TPSExec; P: TPSExternalProcRec): Boolean;
var
s, s2, s3: tbtstring;
h, i: Longint;
@ -103,7 +102,6 @@ begin
begin
// don't pass an empty filename to LoadLibrary, just treat it as uncallable
p.Ext2 := Pointer(1);
ErrorCode := ERROR_MOD_NOT_FOUND;
Result := False;
exit;
end;
@ -127,7 +125,6 @@ begin
if dllhandle = 0 then
begin
p.Ext2 := Pointer(1);
ErrorCode := GetLastError;
Result := False;
exit;
end;
@ -146,7 +143,6 @@ begin
if p.Ext1 = nil then
begin
p.Ext2 := Pointer(1);
ErrorCode := GetLastError;
Result := false;
exit;
end;
@ -163,7 +159,6 @@ var
CurrStack: Cardinal;
cc: TPSCallingConvention;
s: tbtstring;
Dummy: LongInt;
begin
if p.Ext2 <> nil then // error
begin
@ -172,7 +167,7 @@ begin
end;
if p.Ext1 = nil then
begin
if not LoadDll(Caller, P, Dummy) then
if not LoadDll(Caller, P) then
begin
Result := false;
exit;
@ -223,14 +218,7 @@ end;
function ProcessDllImportEx(Caller: TPSExec; P: TPSExternalProcRec; ForceDelayLoad: Boolean): Boolean;
var
Dummy1: Boolean;
Dummy2: LongInt;
begin
Result := ProcessDllImportEx2(Caller, P, ForceDelayLoad, Dummy1, Dummy2);
end;
function ProcessDllImportEx2(Caller: TPSExec; P: TPSExternalProcRec; ForceDelayLoad: Boolean; var DelayLoad: Boolean; var ErrorCode: LongInt): Boolean;
var
DelayLoad: Boolean;
s: tbtstring;
begin
if not ForceDelayLoad then begin
@ -246,7 +234,7 @@ begin
Result := True;
end else begin
p.ProcPtr := DllProc;
Result := LoadDll(Caller, p, ErrorCode);
Result := LoadDll(Caller, p);
end;
end;