Преглед на файлове

* fixed compilation of tbs/tb0460.pp for targets where currency is stored as ordinal.

git-svn-id: trunk@5672 -
yury преди 18 години
родител
ревизия
8765e488ac
променени са 1 файла, в които са добавени 7 реда и са изтрити 3 реда
  1. 7 3
      compiler/ninl.pas

+ 7 - 3
compiler/ninl.pas

@@ -139,6 +139,7 @@ implementation
         source  : tcallparanode;
         procname: string;
         is_real : boolean;
+        rt : aint;
 
       begin
         result := cerrornode.create;
@@ -169,7 +170,7 @@ implementation
             exit;
           end;
 
-        is_real := source.resultdef.typ = floatdef;
+        is_real := (source.resultdef.typ = floatdef) or is_currency(source.resultdef);
 
         if ((dest.left.resultdef.typ<>stringdef) and
             not(is_chararray(dest.left.resultdef))) or
@@ -221,9 +222,12 @@ implementation
         if is_real then
           begin
             { insert realtype parameter }
+            if source.resultdef.typ = floatdef then
+              rt:=ord(tfloatdef(source.left.resultdef).floattype)
+            else
+              rt:=ord(tfloatdef(pbestrealtype^).floattype);
             newparas.right := ccallparanode.create(cordconstnode.create(
-              ord(tfloatdef(source.left.resultdef).floattype),s32inttype,true),
-               newparas.right);
+              rt,s32inttype,true),newparas.right);
             { if necessary, insert a fraction parameter }
             if not assigned(fracpara) then
               begin