mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 22:58:50 +02:00
lcl: fix fpc 2.5.1 compilation for x64
git-svn-id: trunk@23385 -
This commit is contained in:
parent
1af2edb94e
commit
ac0a784f15
@ -90,12 +90,17 @@ type
|
||||
procedure EnumerateItems(const Method: TLCLEnumItemsMethod);
|
||||
end;
|
||||
|
||||
{$IF (FPC_VERSION=2) AND (FPC_RELEASE>4)}
|
||||
TStreamSizeType = PtrInt;
|
||||
{$ELSE}
|
||||
TStreamSizeType = Longint;
|
||||
{$IFEND}
|
||||
|
||||
{ TExtMemoryStream }
|
||||
|
||||
TExtMemoryStream = class(TMemoryStream)
|
||||
protected
|
||||
function Realloc(var NewCapacity: Longint): Pointer; override;
|
||||
function Realloc(var NewCapacity: TStreamSizeType): Pointer; override;
|
||||
public
|
||||
property Capacity;
|
||||
end;
|
||||
@ -275,12 +280,12 @@ end;
|
||||
|
||||
{ TExtMemoryStream }
|
||||
|
||||
function TExtMemoryStream.Realloc(var NewCapacity: LongInt): Pointer;
|
||||
function TExtMemoryStream.Realloc(var NewCapacity: TStreamSizeType): Pointer;
|
||||
begin
|
||||
// if we are growing, grow at least a quarter
|
||||
if (NewCapacity>Capacity) then
|
||||
if (NewCapacity > Capacity) then
|
||||
NewCapacity := Max(NewCapacity, Capacity + Capacity div 4);
|
||||
Result:=inherited Realloc(NewCapacity);
|
||||
Result := inherited Realloc(NewCapacity);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user