Browse Source

* patch by Rika: makes #39786 work on more setups, resolves #39786

florian 3 years ago
parent
commit
f6b5c513bb
2 changed files with 6 additions and 2 deletions
  1. 4 0
      compiler/i386/cpuinfo.pas
  2. 2 2
      compiler/nadd.pas

+ 4 - 0
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;

+ 2 - 2
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                                       }