merge r17330 from cpstrnew branch by michael:

* Patch from inoussa to handle pwchararray to ansistr

git-svn-id: trunk@19106 -
This commit is contained in:
paul 2011-09-17 13:07:03 +00:00
parent fbc01291c4
commit 29c6b034aa

View File

@ -920,6 +920,29 @@ implementation
addstatement(newstat,ctemprefnode.create(restemp));
result:=newblock;
end
else if is_widechar(tarraydef(left.resultdef).elementdef) and
(tstringdef(resultdef).stringtype=st_ansistring) then
begin
result:=ccallnode.createinternres(
'fpc_'+chartype+'array_to_'+tstringdef(resultdef).stringtypname,
ccallparanode.create(
cordconstnode.create(
ord(tarraydef(left.resultdef).lowrange=0),
booltype,
false
),
ccallparanode.create(
cordconstnode.create(
tstringdef(resultdef).encoding,
u16inttype,
true
),
ccallparanode.create(left,nil)
)
),
resultdef
);
end
else
result:=ccallnode.createinternres(
'fpc_'+chartype+'array_to_'+tstringdef(resultdef).stringtypname,