summaryrefslogtreecommitdiff
path: root/compiler/pdecl.pas
diff options
context:
space:
mode:
authorpeter <peter@3ad0048d-3df7-0310-abae-a5850022a9f2>2005-07-18 12:54:15 +0000
committerpeter <peter@3ad0048d-3df7-0310-abae-a5850022a9f2>2005-07-18 12:54:15 +0000
commit349e400acd8968737376d7ce6a9c96871b3d927c (patch)
treebc3d729e1ec9626d169473f96512b158b71638b4 /compiler/pdecl.pas
parentb121138933a6c085605210de13eb2795127b3a5f (diff)
downloadfpc-349e400acd8968737376d7ce6a9c96871b3d927c.tar.gz
* support for widestrings in tconstsym
* fix widestring writing for stringconstn git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@646 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/pdecl.pas')
-rw-r--r--compiler/pdecl.pas20
1 files changed, 15 insertions, 5 deletions
diff --git a/compiler/pdecl.pas b/compiler/pdecl.pas
index c385535b57..082efd7ab1 100644
--- a/compiler/pdecl.pas
+++ b/compiler/pdecl.pas
@@ -49,12 +49,12 @@ implementation
{ common }
cutils,cclasses,
{ global }
- globtype,tokens,verbose,
+ globtype,tokens,verbose,widestr,
systems,
{ aasm }
aasmbase,aasmtai,fmodule,
{ symtable }
- symconst,symbase,symtype,symdef,symtable,paramgr,
+ symconst,symbase,symtype,symdef,symtable,paramgr,defutil,
{ pass 1 }
nmat,nadd,ncal,nset,ncnv,ninl,ncon,nld,nflw,nobj,
{ codegen }
@@ -75,6 +75,7 @@ implementation
pd : pbestreal;
pg : pguid;
sp : pchar;
+ pw : pcompilerwidestring;
storetokenpos : tfileposinfo;
begin
readconstant:=nil;
@@ -94,9 +95,18 @@ implementation
end;
stringconstn:
begin
- getmem(sp,tstringconstnode(p).len+1);
- move(tstringconstnode(p).value_str^,sp^,tstringconstnode(p).len+1);
- hp:=tconstsym.create_string(orgname,conststring,sp,tstringconstnode(p).len);
+ if is_widestring(p.resulttype.def) then
+ begin
+ initwidestring(pw);
+ copywidestring(pcompilerwidestring(tstringconstnode(p).value_str),pw);
+ hp:=tconstsym.create_wstring(orgname,constwstring,pw);
+ end
+ else
+ begin
+ getmem(sp,tstringconstnode(p).len+1);
+ move(tstringconstnode(p).value_str^,sp^,tstringconstnode(p).len+1);
+ hp:=tconstsym.create_string(orgname,conststring,sp,tstringconstnode(p).len);
+ end;
end;
realconstn :
begin