Browse Source

merge r17327 from cpstrnew branch by michael:
* Patch from Inoussa to fix first test case

git-svn-id: trunk@19105 -

paul 14 years ago
parent
commit
fbc01291c4
1 changed files with 15 additions and 0 deletions
  1. 15 0
      compiler/ncnv.pas

+ 15 - 0
compiler/ncnv.pas

@@ -1431,6 +1431,21 @@ implementation
             addstatement(newstat,ctemprefnode.create(restemp));
             addstatement(newstat,ctemprefnode.create(restemp));
             result:=newblock;
             result:=newblock;
           end
           end
+        else if tstringdef(resultdef).stringtype=st_ansistring then
+          begin
+            result:=ccallnode.createinternres(
+                        'fpc_pwidechar_to_'+tstringdef(resultdef).stringtypname,
+                         ccallparanode.create(
+                           cordconstnode.create(
+                             tstringdef(resultdef).encoding,
+                             u16inttype,
+                             true
+                           ),
+                           ccallparanode.create(left,nil)
+                         ),
+                         resultdef
+                      );
+          end
         else
         else
           result := ccallnode.createinternres(
           result := ccallnode.createinternres(
             'fpc_pwidechar_to_'+tstringdef(resultdef).stringtypname,
             'fpc_pwidechar_to_'+tstringdef(resultdef).stringtypname,