* get rid of some feature checks, probably the whole feature stuff is plainly the wrong way, embedded rtl compiles again, resolves #20913

git-svn-id: trunk@19907 -
This commit is contained in:
florian 2011-12-29 14:06:30 +00:00
parent c4c20102fd
commit 6a1a2d3464
7 changed files with 19 additions and 22 deletions

View File

@ -1,5 +1,10 @@
# first, disable all
-Sf-
# enable required ones
# they don't add much additional code or data
-SfTEXTIO
-SfFILEIO
-SfHEAP
# uncomment to enable the stuff you want to use
# include full heap management into the rtl
@ -33,3 +38,4 @@
#ifdef CPUARM
-SfSOFTFPU
#endif CPUARM

View File

@ -366,7 +366,7 @@ Function fpc_Char_To_WChar(const c : Char): WideChar; compilerproc;
Function fpc_WChar_To_Char(const c : WideChar): Char; compilerproc;
{$endif FPC_HAS_FEATURE_WIDESTRINGS}
{$ifdef FPC_HAS_FEATURE_TEXTIO}
{ $ifdef FPC_HAS_FEATURE_TEXTIO}
{ from text.inc }
Function fpc_get_input:PText;compilerproc;
Function fpc_get_output:PText;compilerproc;
@ -433,7 +433,7 @@ function fpc_SetupReadStr_Unicodestr(const s: unicodestring): PText; compilerpro
{$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING}
function fpc_SetupReadStr_Widestr(const s: widestring): PText; compilerproc;
{$endif FPC_WIDESTRING_EQUAL_UNICODESTRING}
{$endif FPC_HAS_FEATURE_TEXTIO}
{ $endif FPC_HAS_FEATURE_TEXTIO}
{$ifdef FPC_HAS_FEATURE_VARIANTS}
procedure fpc_variant_init(var v: tvardata);compilerproc;

View File

@ -270,6 +270,7 @@ begin
{$endif HAS_MEMORYMANAGER}
end;
{$ifdef FPC_HAS_FEATURE_HEAP}
procedure GetMem(Out p:pointer;Size:ptruint);
begin
p := MemoryManager.GetMem(Size);
@ -357,8 +358,10 @@ procedure fpc_freemem(p:pointer);compilerproc;[public,alias:'FPC_FREEMEM'];
begin
MemoryManager.FreeMem(p);
end;
{$endif FPC_HAS_FEATURE_HEAP}
{$endif FPC_IN_HEAPMGR}
{$if defined(FPC_HAS_FEATURE_HEAP) or defined(FPC_IN_HEAPMGR)}
{$ifndef HAS_MEMORYMANAGER}
{*****************************************************************************
GetHeapStatus
@ -1615,3 +1618,5 @@ begin
end;
{$endif HAS_MEMORYMANAGER}
{$endif defined(FPC_HAS_FEATURE_HEAP) or defined(FPC_IN_HEAPMGR)}

View File

@ -78,6 +78,7 @@ function SysGetHeapStatus:THeapStatus;
function SysGetFPCHeapStatus:TFPCHeapStatus;
{$endif EMBEDDED}
{$ifdef FPC_HAS_FEATURE_HEAP}
{ Tp7 functions }
Procedure Getmem(Out p:pointer;Size:ptruint);
Procedure Getmemory(Out p:pointer;Size:ptruint);
@ -97,6 +98,5 @@ function ReAllocMem(var p:pointer;Size:ptruint):pointer;
function ReAllocMemory(p:pointer;Size:ptruint):pointer; cdecl;
function GetHeapStatus:THeapStatus;
function GetFPCHeapStatus:TFPCHeapStatus;
{ Bootstrapping }
{$endif FPC_HAS_FEATURE_HEAP}

View File

@ -64,9 +64,7 @@ Const
{$i filerec.inc}
{$endif FPC_HAS_FEATURE_FILEIO}
{$ifdef FPC_HAS_FEATURE_TEXTIO}
{$i textrec.inc}
{$endif FPC_HAS_FEATURE_TEXTIO}
{$ifdef FPC_HAS_FEATURE_EXITCODE}
{$ifdef FPC_OBJFPC_EXTENDED_IF}
@ -86,7 +84,6 @@ type
FileFunc = Procedure(var t : TextRec);
{$endif FPC_HAS_FEATURE_TEXTIO}
const
STACK_MARGIN = 16384; { Stack size margin for stack checking }
{ Random / Randomize constants }
@ -1012,14 +1009,13 @@ Begin
Halt(0);
End;
Procedure Error(RunTimeError : TRunTimeError);
Procedure Error(RunTimeError : TRunTimeError);
begin
RunError(RuntimeErrorExitCodes[RunTimeError]);
end;
{$ifdef FPC_HAS_FEATURE_CONSOLEIO}
Procedure dump_stack(var f : text;bp : Pointer);
var
i : Longint;
@ -1074,8 +1070,6 @@ begin
end;
{$endif FPC_HAS_FEATURE_EXCEPTIONS}
{$endif FPC_HAS_FEATURE_CONSOLEIO}
{$ifdef FPC_HAS_FEATURE_HEAP}
Type
@ -1276,11 +1270,9 @@ end;
Heap
*****************************************************************************}
{$ifdef FPC_HAS_FEATURE_HEAP}
{$i sysheap.inc}
{$i heap.inc}
{$endif FPC_HAS_FEATURE_HEAP}
{*****************************************************************************
Thread support
@ -1332,9 +1324,7 @@ end;
{$endif FPC_HAS_FEATURE_FILEIO}
{ Text file }
{$ifdef FPC_HAS_FEATURE_TEXTIO}
{$i text.inc}
{$endif FPC_HAS_FEATURE_TEXTIO}
{$ifdef FPC_HAS_FEATURE_FILEIO}
{ Untyped file }

View File

@ -1118,12 +1118,10 @@ Function Paramcount:Longint;
Function ParamStr(l:Longint):string;
{$endif FPC_HAS_FEATURE_COMMANDARGS}
{$ifdef FPC_HAS_FEATURE_CONSOLEIO}
Procedure Dump_Stack(var f : text;bp:pointer);
{$ifdef FPC_HAS_FEATURE_EXCEPTIONS}
procedure DumpExceptionBackTrace(var f:text);
{$endif FPC_HAS_FEATURE_EXCEPTIONS}
{$endif FPC_HAS_FEATURE_CONSOLEIO}
Procedure RunError(w:Word);
Procedure RunError;{$ifdef SYSTEMINLINE}inline;{$endif}
@ -1229,9 +1227,7 @@ const
Heap
*****************************************************************************}
{$ifdef FPC_HAS_FEATURE_HEAP}
{$i heaph.inc}
{$endif FPC_HAS_FEATURE_HEAP}
{*****************************************************************************
Thread support

View File

@ -704,7 +704,7 @@ begin
fpc_WriteBlanks(f,Len-SLen);
if slen > 0 then
begin
{$ifdef FPC_HAS_CPSTRING}
{$if defined(FPC_HAS_CPSTRING) and defined(FPC_HAS_FEATURE_ANSISTRINGS)}
a:=fpc_AnsiStr_To_AnsiStr(S,TextRec(f).CodePage);
fpc_WriteBuffer(f,PAnsiChar(a)^,Length(a));
{$else}
@ -2020,14 +2020,14 @@ begin
fmInput :
begin
TextRec(f).InOutFunc:=@FileReadFunc;
{$ifdef FPC_HAS_CPSTRING}
{$if defined(FPC_HAS_CPSTRING) and defined(FPC_HAS_FEATURE_WIDESTRINGS)}
TextRec(f).CodePage:=WideStringManager.GetStandardCodePageProc(scpConsoleInput);
{$endif}
end;
fmOutput :
begin
TextRec(f).InOutFunc:=@FileWriteFunc;
{$ifdef FPC_HAS_CPSTRING}
{$if defined(FPC_HAS_CPSTRING) and defined(FPC_HAS_FEATURE_WIDESTRINGS)}
TextRec(f).CodePage:=WideStringManager.GetStandardCodePageProc(scpConsoleOutput);
{$endif}
if Do_Isdevice(hdl) then