1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2024-11-24 08:02:15 +02:00

Workaround for issue #333

Disabled range checking in some units when using old Delphi versions to avoid internal compiler errors.
This commit is contained in:
Salvador Diaz Fau 2021-01-05 11:44:41 +01:00
parent bef1626f31
commit 83cf65a8ec
5 changed files with 30 additions and 10 deletions

View File

@ -46,6 +46,11 @@ unit uCEFApplicationCore;
{$I cef.inc}
{$IFNDEF FPC}{$IFNDEF DELPHI12_UP}
// Workaround for "Internal error" in old Delphi versions caused by uint64 handling
{$R-}
{$ENDIF}{$ENDIF}
interface
uses
@ -2234,8 +2239,7 @@ var
{$ENDIF}
begin
Result := 0;
{$IFDEF MSWINDOWS}
{$IFDEF MSWINDOWS}
TempHandle := CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
if (TempHandle = INVALID_HANDLE_VALUE) then exit;
@ -2264,7 +2268,8 @@ begin
ZeroMemory(@TempMemCtrs, SizeOf(TProcessMemoryCounters));
TempMemCtrs.cb := SizeOf(TProcessMemoryCounters);
if GetProcessMemoryInfo(TempProcHWND, {$IFNDEF FPC}@{$ENDIF}TempMemCtrs, TempMemCtrs.cb) then inc(Result, TempMemCtrs.WorkingSetSize);
if GetProcessMemoryInfo(TempProcHWND, {$IFNDEF FPC}@{$ENDIF}TempMemCtrs, TempMemCtrs.cb) then
inc(Result, TempMemCtrs.WorkingSetSize);
CloseHandle(TempProcHWND);
end;
@ -2273,7 +2278,7 @@ begin
until not(Process32Next(TempHandle, TempProcess));
CloseHandle(TempHandle);
{$ENDIF}
{$ENDIF}
end;
function TCefApplicationCore.GetTotalSystemMemory : uint64;
@ -2283,11 +2288,11 @@ var
{$ENDIF}
begin
Result := 0;
{$IFDEF MSWINDOWS}
ZeroMemory(@TempMemStatus, SizeOf(TMyMemoryStatusEx));
TempMemStatus.dwLength := SizeOf(TMyMemoryStatusEx);
if GetGlobalMemoryStatusEx(TempMemStatus) then Result := TempMemStatus.ullTotalPhys;
if GetGlobalMemoryStatusEx(TempMemStatus) then
Result := TempMemStatus.ullTotalPhys;
{$ENDIF}
end;
@ -2298,11 +2303,11 @@ var
{$ENDIF}
begin
Result := 0;
{$IFDEF MSWINDOWS}
ZeroMemory(@TempMemStatus, SizeOf(TMyMemoryStatusEx));
TempMemStatus.dwLength := SizeOf(TMyMemoryStatusEx);
if GetGlobalMemoryStatusEx(TempMemStatus) then Result := TempMemStatus.ullAvailPhys;
if GetGlobalMemoryStatusEx(TempMemStatus) then
Result := TempMemStatus.ullAvailPhys;
{$ENDIF}
end;

View File

@ -43,6 +43,11 @@ unit uCEFDragAndDropMgr;
{$I cef.inc}
{$IFNDEF FPC}{$IFNDEF DELPHI12_UP}
// Workaround for "Internal error" in old Delphi versions caused by uint64 handling
{$R-}
{$ENDIF}{$ENDIF}
interface
uses

View File

@ -46,6 +46,11 @@ unit uCEFMiscFunctions;
{$I cef.inc}
{$IFNDEF FPC}{$IFNDEF DELPHI12_UP}
// Workaround for "Internal error" in old Delphi versions caused by uint64 handling
{$R-}
{$ENDIF}{$ENDIF}
interface
uses

View File

@ -1,4 +1,4 @@
// ************************************************************************
// ************************************************************************
// ***************************** CEF4Delphi *******************************
// ************************************************************************
//
@ -43,6 +43,11 @@ unit uCEFOLEDragAndDrop;
{$I cef.inc}
{$IFNDEF FPC}{$IFNDEF DELPHI12_UP}
// Workaround for "Internal error" in old Delphi versions caused by uint64 handling
{$R-}
{$ENDIF}{$ENDIF}
interface
uses

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 222,
"InternalVersion" : 223,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "87.1.12.0"
}