mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-19 17:11:41 +02:00
+ fixed startup hang in the i8086-msdos rtl on systems without an FPU
git-svn-id: trunk@24455 -
This commit is contained in:
parent
39cee28f01
commit
f1861a71d6
@ -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;
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user