+ fixed startup hang in the i8086-msdos rtl on systems without an FPU

git-svn-id: trunk@24455 -
This commit is contained in:
nickysn 2013-05-06 21:36:37 +00:00
parent 39cee28f01
commit f1861a71d6
2 changed files with 14 additions and 1 deletions

View File

@ -136,6 +136,18 @@ const
fpucw : word = $1300 or FPU_StackUnderflow or FPU_Underflow or FPU_Denormal;
}
{ returns true if FPU is present }
function DetectFPU: boolean;
var
localfpucw: word;
begin
asm
fninit
mov byte [localfpucw + 1], 0
fnstcw localfpucw
end;
DetectFPU:=(localfpucw and $FF00)=$0300;
end;
{$define FPC_SYSTEM_HAS_SYSINITFPU}
Procedure SysInitFPU;

View File

@ -214,7 +214,8 @@ end;
begin
StackLength := CheckInitialStkLen(InitialStkLen);
StackBottom := __stkbottom;
SysInitFPU;
if DetectFPU then
SysInitFPU;
{ To be set if this is a GUI or console application }
IsConsole := TRUE;
{ To be set if this is a library and not a program }