Browse Source

* fixed to compile with 1.1

florian 23 years ago
parent
commit
f0e2409c9f
1 changed files with 17 additions and 9 deletions
  1. 17 9
      compiler/powerpc/nppccnv.pas

+ 17 - 9
compiler/powerpc/nppccnv.pas

@@ -107,9 +107,12 @@ implementation
     procedure tppctypeconvnode.second_int_to_real;
     procedure tppctypeconvnode.second_int_to_real;
 
 
       type
       type
-        dummyrec = record
-          i: int64;
-        end;
+        tdummyarray = packed array[0..7] of byte;
+
+      const
+         dummyarray1 : tdummyarray = ($00,$00,$00,$80,$00,$00,$30,$43);
+         dummyarray2 : tdummyarray = ($00,$00,$00,$00,$00,$00,$30,$43);
+
       var
       var
         tempconst: trealconstnode;
         tempconst: trealconstnode;
         ref: treference;
         ref: treference;
@@ -143,15 +146,17 @@ implementation
         { we need a certain constant for the conversion, so create it here }
         { we need a certain constant for the conversion, so create it here }
         if signed then
         if signed then
           tempconst :=
           tempconst :=
-            { we need this strange typecast because we want the }
-            { double represented by $4330000080000000, not the  }
-            { double converted from the integer with that value }
-            crealconstnode.create(double(dummyrec($4330000080000000)),
+            { the array of byte is necessary because 1. the 1.0.x compiler
+              doesn't know 64 constants, 2. it won't work with big endian
+              and little endian machines at the same time (FK)
+            }
+            crealconstnode.create(double(dummyarray1),
             pbestrealtype^)
             pbestrealtype^)
         else
         else
           tempconst :=
           tempconst :=
-            crealconstnode.create(double(dummyrec($4330000000000000)),
+            crealconstnode.create(double(dummyarray2),
             pbestrealtype^);
             pbestrealtype^);
+
         resulttypepass(tempconst);
         resulttypepass(tempconst);
         firstpass(tempconst);
         firstpass(tempconst);
         secondpass(tempconst);
         secondpass(tempconst);
@@ -372,7 +377,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  2002-07-11 14:41:34  florian
+  Revision 1.12  2002-07-12 22:02:22  florian
+    * fixed to compile with 1.1
+
+  Revision 1.11  2002/07/11 14:41:34  florian
     * start of the new generic parameter handling
     * start of the new generic parameter handling
 
 
   Revision 1.10  2002/07/11 07:42:31  jonas
   Revision 1.10  2002/07/11 07:42:31  jonas