* some fixes, intended to get units fgl and classes to compile on 16-bit cpus

git-svn-id: trunk@24649 -
This commit is contained in:
nickysn 2013-05-30 18:58:25 +00:00
parent 6ad761912f
commit 730f7c82b7
6 changed files with 102 additions and 3 deletions

1
.gitattributes vendored
View File

@ -8259,6 +8259,7 @@ rtl/msdos/sysos.inc svneol=native#text/plain
rtl/msdos/sysosh.inc svneol=native#text/plain
rtl/msdos/system.pp svneol=native#text/plain
rtl/msdos/sysutils.pp svneol=native#text/plain
rtl/msdos/tthread.inc svneol=native#text/plain
rtl/msdos/varutils.pp svneol=native#text/plain
rtl/nativent/Makefile svneol=native#text/plain
rtl/nativent/Makefile.fpc svneol=native#text/plain

86
rtl/msdos/tthread.inc Normal file
View File

@ -0,0 +1,86 @@
{
This file is part of the Free Component Library (FCL)
Copyright (c) 1999-2000 by the Free Pascal development team
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{****************************************************************************}
{* TThread *}
{****************************************************************************}
procedure TThread.CallOnTerminate;
begin
end;
function TThread.GetPriority: TThreadPriority;
begin
GetPriority:=tpNormal;
end;
procedure TThread.SetPriority(Value: TThreadPriority);
begin
end;
procedure TThread.SetSuspended(Value: Boolean);
begin
end;
procedure TThread.DoTerminate;
begin
end;
procedure TThread.SysCreate(CreateSuspended: Boolean; const StackSize: SizeUInt);
begin
{IsMultiThread := TRUE; }
end;
procedure TThread.SysDestroy;
begin
end;
procedure TThread.Resume;
begin
end;
procedure TThread.Suspend;
begin
end;
procedure TThread.Terminate;
begin
end;
function TThread.WaitFor: Integer;
begin
WaitFor:=0;
end;

View File

@ -46,7 +46,11 @@ const
{ Maximum TList size }
{$ifdef cpu16}
MaxListSize = {Maxint div 16}1024;
{$else cpu16}
MaxListSize = Maxint div 16;
{$endif cpu16}
{ values for TShortCut }
@ -377,7 +381,11 @@ const
BITSHIFT = 5;
MASK = 31; {for longs that are 32-bit in size}
// to further increase, signed integer limits have to be researched.
{$ifdef cpu16}
MaxBitFlags = $7FE0;
{$else cpu16}
MaxBitFlags = $7FFFFFE0;
{$endif cpu16}
MaxBitRec = MaxBitFlags Div (SizeOf(cardinal)*8);
type
TBitArray = array[0..MaxBitRec - 1] of cardinal;
@ -960,7 +968,7 @@ type
procedure Clear;
procedure LoadFromStream(Stream: TStream);
procedure LoadFromFile(const FileName: string);
procedure SetSize({$ifdef CPU64}const{$endif CPU64} NewSize: PtrInt); override;
procedure SetSize({$ifdef CPU64}const NewSize: Int64{$else}NewSize: LongInt{$endif}); override;
function Write(const Buffer; Count: LongInt): LongInt; override;
end;

View File

@ -523,7 +523,7 @@ type
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
record
Count: Word;
Entries: array[Word] of TPersistentClass;
Entries: array[{$ifdef cpu16}0..16384 div sizeof(TPersistentClass){$else}Word{$endif}] of TPersistentClass;
end;
PFieldTable = ^TFieldTable;

View File

@ -718,7 +718,7 @@ begin
end;
procedure TMemoryStream.SetSize({$ifdef CPU64}const{$endif CPU64} NewSize: PtrInt);
procedure TMemoryStream.SetSize({$ifdef CPU64}const NewSize: Int64{$else}NewSize: LongInt{$endif});
begin
SetCapacity (NewSize);

View File

@ -89,7 +89,11 @@ type
end;
const
{$ifdef cpu16}
MaxGListSize = {MaxInt div} 1024;
{$else cpu16}
MaxGListSize = MaxInt div 1024;
{$endif cpu16}
type
generic TFPGListEnumerator<T> = class(TObject)