From f6b5c513bb73bc476a71769e094ea8401eab13eb Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 7 Jul 2022 23:00:12 +0200 Subject: [PATCH] * patch by Rika: makes #39786 work on more setups, resolves #39786 --- compiler/i386/cpuinfo.pas | 4 ++++ compiler/nadd.pas | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/i386/cpuinfo.pas b/compiler/i386/cpuinfo.pas index c0f6140d68..37684112e9 100644 --- a/compiler/i386/cpuinfo.pas +++ b/compiler/i386/cpuinfo.pas @@ -30,7 +30,11 @@ Interface Type bestreal = extended; +{$ifdef FPC_HAS_TYPE_EXTENDED} bestrealrec = TExtended80Rec; +{$else} + bestrealrec = TDoubleRec; +{$endif} ts32real = single; ts64real = double; ts80real = extended; diff --git a/compiler/nadd.pas b/compiler/nadd.pas index 3b7eeb4830..5149df5070 100644 --- a/compiler/nadd.pas +++ b/compiler/nadd.pas @@ -1134,7 +1134,7 @@ implementation end; end; -{$if not defined(FPC_SOFT_FPUX80)} +{$if sizeof(bestrealrec) = sizeof(bestreal)} { replace .../const by a multiplication, but only if fastmath is enabled or the division is done by a power of 2, do not mess with special floating point values like Inf etc. @@ -1181,7 +1181,7 @@ implementation else ; end; -{$endif not defined(FPC_SOFT_FPUX80)} +{$endif sizeof(bestrealrec) = sizeof(bestreal)} { first, we handle widestrings, so we can check later for } { stringconstn only }