diff --git a/rtl/atari/system.pas b/rtl/atari/system.pas index 0ea4586854..70e369390f 100644 --- a/rtl/atari/system.pas +++ b/rtl/atari/system.pas @@ -747,8 +747,13 @@ end; SystemUnit Initialization *****************************************************************************} +function CheckInitialStkLen (StkLen: SizeUInt): SizeUInt; +begin + CheckInitialStkLen := StkLen; +end; begin + StackLength := CheckInitialStkLen (InitialStkLen); { Initialize ExitProc } ExitProc:=Nil; { Setup heap } diff --git a/rtl/beos/system.pp b/rtl/beos/system.pp index 4b12f72c66..e984f3346c 100644 --- a/rtl/beos/system.pp +++ b/rtl/beos/system.pp @@ -531,6 +531,7 @@ begin myheaprealsize:=$2000; myheapstart:=nil; heap_handle:=sys_create_area('fpcheap',myheapstart,0,myheaprealsize,0,3);//!! + StackLength := CheckInitialStkLen (InitialStkLen); if heap_handle>0 then begin InitHeap; end else system_exit; diff --git a/rtl/emx/system.pas b/rtl/emx/system.pas index 327287f3c1..b7b5118d39 100644 --- a/rtl/emx/system.pas +++ b/rtl/emx/system.pas @@ -445,6 +445,11 @@ begin else GetFileHandleCount := L2; end; +function CheckInitialStkLen (StkLen: SizeUInt): SizeUInt; +begin + CheckInitialStkLen := StkLen; +end; + var TIB: PThreadInfoBlock; PIB: PProcessInfoBlock; @@ -558,6 +563,7 @@ begin end; end; exitproc:=nil; + StackLength := CheckInitialStkLen (InitialStkLen); {Initialize the heap.} initheap; diff --git a/rtl/os2/system.pas b/rtl/os2/system.pas index 1969a8626e..5d97325d84 100644 --- a/rtl/os2/system.pas +++ b/rtl/os2/system.pas @@ -694,6 +694,11 @@ begin else GetFileHandleCount := L2; end; +function CheckInitialStkLen (StkLen: SizeUInt): SizeUInt; +begin + CheckInitialStkLen := StkLen; +end; + var TIB: PThreadInfoBlock; RC: cardinal; ErrStr: string; @@ -707,6 +712,7 @@ begin DosGetInfoBlocks (@TIB, @PIB); StackBottom := TIB^.Stack; StackTop := PtrUInt (TIB^.StackLimit); + StackLength := CheckInitialStkLen (InitialStkLen); {Set type of application} ApplicationType := PIB^.ProcType; diff --git a/rtl/palmos/system.pp b/rtl/palmos/system.pp index bccdf46e89..e4a31a71f9 100644 --- a/rtl/palmos/system.pp +++ b/rtl/palmos/system.pp @@ -110,5 +110,6 @@ begin end; begin + StackLength := CheckInitialStkLen (InitialStkLen); ExitCode:=0; end.