mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 10:39:29 +02:00
113 lines
2.3 KiB
ObjectPascal
113 lines
2.3 KiB
ObjectPascal
unit system;
|
|
interface
|
|
|
|
{$DEFINE FPCRTL_FILESYSTEM_SINGLE_BYTE_API}
|
|
|
|
{$I systemh.inc}
|
|
|
|
{$ifndef FPUNONE}
|
|
{$ifdef FPC_HAS_FEATURE_SOFTFPU}
|
|
|
|
{$define fpc_softfpu_interface}
|
|
{$i softfpu.pp}
|
|
{$undef fpc_softfpu_interface}
|
|
|
|
{$endif FPC_HAS_FEATURE_SOFTFPU}
|
|
|
|
{$endif FPUNONE}
|
|
|
|
const
|
|
maxExitCode = 255;
|
|
AllowDirectorySeparators : set of AnsiChar = ['\','/'];
|
|
DirectorySeparator = '/';
|
|
{ Default filehandles }
|
|
UnusedHandle = $ffff;{ instead of -1, as it is a word value}
|
|
StdInputHandle = 0;
|
|
StdOutputHandle = 1;
|
|
StdErrorHandle = 2;
|
|
CtrlZMarksEOF: boolean = true; (* #26 is considered as end of file *)
|
|
DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCR;
|
|
LineEnding = #10;
|
|
PathSeparator = '/';
|
|
MaxPathLen = 255;
|
|
LFNSupport = true;
|
|
FileNameCaseSensitive = true;
|
|
sLineBreak = #13;
|
|
|
|
var
|
|
argc:longint=0;
|
|
argv:PPAnsiChar;
|
|
envp:PPAnsiChar;
|
|
|
|
implementation
|
|
|
|
procedure _InitHeap(p: pdword; l: dword); external name 'InitHeap2';
|
|
procedure _free(p: pointer); external name 'free2';
|
|
function _malloc(l: dword): pointer; external name 'malloc2';
|
|
|
|
{I ../mips/setjump.inc}
|
|
{$I system.inc}
|
|
|
|
{$ifndef FPUNONE}
|
|
{$ifdef FPC_HAS_FEATURE_SOFTFPU}
|
|
|
|
{$define fpc_softfpu_implementation}
|
|
{$i softfpu.pp}
|
|
{$undef fpc_softfpu_implementation}
|
|
|
|
{ we get these functions and types from the softfpu code }
|
|
{$define FPC_SYSTEM_HAS_float64}
|
|
{$define FPC_SYSTEM_HAS_float32}
|
|
{$define FPC_SYSTEM_HAS_flag}
|
|
{$define FPC_SYSTEM_HAS_extractFloat64Frac0}
|
|
{$define FPC_SYSTEM_HAS_extractFloat64Frac1}
|
|
{$define FPC_SYSTEM_HAS_extractFloat64Exp}
|
|
{$define FPC_SYSTEM_HAS_extractFloat64Frac}
|
|
{$define FPC_SYSTEM_HAS_extractFloat64Sign}
|
|
{$define FPC_SYSTEM_HAS_ExtractFloat32Frac}
|
|
{$define FPC_SYSTEM_HAS_extractFloat32Exp}
|
|
{$define FPC_SYSTEM_HAS_extractFloat32Sign}
|
|
|
|
{$endif FPC_HAS_FEATURE_SOFTFPU}
|
|
{$endif FPUNONE}
|
|
|
|
procedure Randomize;
|
|
begin
|
|
randseed:= 1234;
|
|
end;
|
|
|
|
function GetProcessID: LongWord;
|
|
begin
|
|
result:= 0;
|
|
end;
|
|
|
|
function ParamCount: LongInt;
|
|
begin
|
|
ParamCount:= 0;
|
|
end;
|
|
|
|
function ParamStr(l: LongInt): ShortString;
|
|
begin
|
|
result:='';
|
|
end;
|
|
|
|
procedure SysInitStdIO;
|
|
begin
|
|
end;
|
|
|
|
function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
|
|
begin
|
|
result:= stklen;
|
|
end;
|
|
|
|
procedure system_exit;
|
|
begin
|
|
repeat
|
|
until false;
|
|
end;
|
|
|
|
|
|
begin
|
|
InOutRes:= 0;
|
|
_InitHeap(pdword($800F8000), $00100000);
|
|
end. |