* mask FPU exceptions during libxml initialization to avoid an fpu exception with newer libxml, resolves #40622

This commit is contained in:
florian 2024-02-08 23:03:04 +01:00
parent be7b9a66db
commit 4fd5237c0e

View File

@ -20,10 +20,12 @@ interface
uses
System.DynLibs,
System.CTypes;
System.Math;
{$ELSE FPC_DOTTEDUNITS}
uses
dynlibs,
ctypes;
ctypes,
math;
{$ENDIF FPC_DOTTEDUNITS}
const
@ -358,6 +360,9 @@ begin
end;
{$ENDIF}
var
mask : TFPUExceptionMask;
initialization
{$IFDEF NO_EXTERNAL_VARS}
LoadExternalVariables;
@ -373,8 +378,12 @@ initialization
* between the version it was compiled for and the actual shared
* library used.
*)
mask:=GetExceptionMask;
SetExceptionMask([exInvalidOp,exDenormalized,exZeroDivide,exOverflow,exUnderflow,exPrecision]);
LIBXML_TEST_VERSION;
SetExceptionMask(mask);
(*
* overloading the error functions
*)