|
@@ -625,8 +625,13 @@ interface
|
|
constructor loadshort(ppufile:tcompilerppufile);
|
|
constructor loadshort(ppufile:tcompilerppufile);
|
|
constructor createlong(l : longint);
|
|
constructor createlong(l : longint);
|
|
constructor loadlong(ppufile:tcompilerppufile);
|
|
constructor loadlong(ppufile:tcompilerppufile);
|
|
|
|
+ {$ifdef ansistring_bits}
|
|
|
|
+ constructor createansi(l:longint;bits:Tstringbits);
|
|
|
|
+ constructor loadansi(ppufile:tcompilerppufile;bits:Tstringbits);
|
|
|
|
+ {$else}
|
|
constructor createansi(l : longint);
|
|
constructor createansi(l : longint);
|
|
constructor loadansi(ppufile:tcompilerppufile);
|
|
constructor loadansi(ppufile:tcompilerppufile);
|
|
|
|
+ {$endif}
|
|
constructor createwide(l : longint);
|
|
constructor createwide(l : longint);
|
|
constructor loadwide(ppufile:tcompilerppufile);
|
|
constructor loadwide(ppufile:tcompilerppufile);
|
|
function getcopy : tstoreddef;override;
|
|
function getcopy : tstoreddef;override;
|
|
@@ -736,7 +741,13 @@ interface
|
|
s32fixedtype, { pointer to type of temp. fixed }
|
|
s32fixedtype, { pointer to type of temp. fixed }
|
|
cshortstringtype, { pointer to type of short string const }
|
|
cshortstringtype, { pointer to type of short string const }
|
|
clongstringtype, { pointer to type of long string const }
|
|
clongstringtype, { pointer to type of long string const }
|
|
|
|
+{$ifdef ansistring_bits}
|
|
|
|
+ cansistringtype16, { pointer to type of ansi string const }
|
|
|
|
+ cansistringtype32, { pointer to type of ansi string const }
|
|
|
|
+ cansistringtype64, { pointer to type of ansi string const }
|
|
|
|
+{$else}
|
|
cansistringtype, { pointer to type of ansi string const }
|
|
cansistringtype, { pointer to type of ansi string const }
|
|
|
|
+{$endif}
|
|
cwidestringtype, { pointer to type of wide string const }
|
|
cwidestringtype, { pointer to type of wide string const }
|
|
openshortstringtype, { pointer to type of an open shortstring,
|
|
openshortstringtype, { pointer to type of an open shortstring,
|
|
needed for readln() }
|
|
needed for readln() }
|
|
@@ -1302,8 +1313,40 @@ implementation
|
|
savesize:=POINTER_SIZE;
|
|
savesize:=POINTER_SIZE;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+{$ifdef ansistring_bits}
|
|
|
|
+ constructor tstringdef.createansi(l:longint;bits:Tstringbits);
|
|
|
|
+ begin
|
|
|
|
+ inherited create;
|
|
|
|
+ case bits of
|
|
|
|
+ sb_16:
|
|
|
|
+ string_typ:=st_ansistring16;
|
|
|
|
+ sb_32:
|
|
|
|
+ string_typ:=st_ansistring32;
|
|
|
|
+ sb_64:
|
|
|
|
+ string_typ:=st_ansistring64;
|
|
|
|
+ end;
|
|
|
|
+ deftype:=stringdef;
|
|
|
|
+ len:=l;
|
|
|
|
+ savesize:=POINTER_SIZE;
|
|
|
|
+ end;
|
|
|
|
|
|
- constructor tstringdef.createansi(l : longint);
|
|
|
|
|
|
+ constructor tstringdef.loadansi(ppufile:tcompilerppufile;bits:Tstringbits);
|
|
|
|
+ begin
|
|
|
|
+ inherited ppuloaddef(ppufile);
|
|
|
|
+ deftype:=stringdef;
|
|
|
|
+ case bits of
|
|
|
|
+ sb_16:
|
|
|
|
+ string_typ:=st_ansistring16;
|
|
|
|
+ sb_32:
|
|
|
|
+ string_typ:=st_ansistring32;
|
|
|
|
+ sb_64:
|
|
|
|
+ string_typ:=st_ansistring64;
|
|
|
|
+ end;
|
|
|
|
+ len:=ppufile.getlongint;
|
|
|
|
+ savesize:=POINTER_SIZE;
|
|
|
|
+ end;
|
|
|
|
+{$else}
|
|
|
|
+ constructor tstringdef.createansi(l:longint);
|
|
begin
|
|
begin
|
|
inherited create;
|
|
inherited create;
|
|
string_typ:=st_ansistring;
|
|
string_typ:=st_ansistring;
|
|
@@ -1312,8 +1355,8 @@ implementation
|
|
savesize:=POINTER_SIZE;
|
|
savesize:=POINTER_SIZE;
|
|
end;
|
|
end;
|
|
|
|
|
|
-
|
|
|
|
constructor tstringdef.loadansi(ppufile:tcompilerppufile);
|
|
constructor tstringdef.loadansi(ppufile:tcompilerppufile);
|
|
|
|
+
|
|
begin
|
|
begin
|
|
inherited ppuloaddef(ppufile);
|
|
inherited ppuloaddef(ppufile);
|
|
deftype:=stringdef;
|
|
deftype:=stringdef;
|
|
@@ -1321,7 +1364,7 @@ implementation
|
|
len:=ppufile.getlongint;
|
|
len:=ppufile.getlongint;
|
|
savesize:=POINTER_SIZE;
|
|
savesize:=POINTER_SIZE;
|
|
end;
|
|
end;
|
|
-
|
|
|
|
|
|
+{$endif}
|
|
|
|
|
|
constructor tstringdef.createwide(l : longint);
|
|
constructor tstringdef.createwide(l : longint);
|
|
begin
|
|
begin
|
|
@@ -1354,10 +1397,17 @@ implementation
|
|
|
|
|
|
|
|
|
|
function tstringdef.stringtypname:string;
|
|
function tstringdef.stringtypname:string;
|
|
|
|
+{$ifdef ansistring_bits}
|
|
|
|
+ const
|
|
|
|
+ typname:array[tstringtype] of string[9]=('',
|
|
|
|
+ 'shortstr','longstr','ansistr16','ansistr32','ansistr64','widestr'
|
|
|
|
+ );
|
|
|
|
+{$else}
|
|
const
|
|
const
|
|
typname:array[tstringtype] of string[8]=('',
|
|
typname:array[tstringtype] of string[8]=('',
|
|
'shortstr','longstr','ansistr','widestr'
|
|
'shortstr','longstr','ansistr','widestr'
|
|
);
|
|
);
|
|
|
|
+{$endif}
|
|
begin
|
|
begin
|
|
stringtypname:=typname[string_typ];
|
|
stringtypname:=typname[string_typ];
|
|
end;
|
|
end;
|
|
@@ -1384,7 +1434,13 @@ implementation
|
|
case string_typ of
|
|
case string_typ of
|
|
st_shortstring : ppufile.writeentry(ibshortstringdef);
|
|
st_shortstring : ppufile.writeentry(ibshortstringdef);
|
|
st_longstring : ppufile.writeentry(iblongstringdef);
|
|
st_longstring : ppufile.writeentry(iblongstringdef);
|
|
|
|
+ {$ifdef ansistring_bits}
|
|
|
|
+ st_ansistring16 : ppufile.writeentry(ibansistring16def);
|
|
|
|
+ st_ansistring32 : ppufile.writeentry(ibansistring32def);
|
|
|
|
+ st_ansistring64 : ppufile.writeentry(ibansistring64def);
|
|
|
|
+ {$else}
|
|
st_ansistring : ppufile.writeentry(ibansistringdef);
|
|
st_ansistring : ppufile.writeentry(ibansistringdef);
|
|
|
|
+ {$endif}
|
|
st_widestring : ppufile.writeentry(ibwidestringdef);
|
|
st_widestring : ppufile.writeentry(ibwidestringdef);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -1423,7 +1479,11 @@ implementation
|
|
[tostr(len+5),longst,tostr(len),charst,tostr(len*8),bytest]);
|
|
[tostr(len+5),longst,tostr(len),charst,tostr(len*8),bytest]);
|
|
{$EndIf}
|
|
{$EndIf}
|
|
end;
|
|
end;
|
|
|
|
+ {$ifdef ansistring_bits}
|
|
|
|
+ st_ansistring16,st_ansistring32,st_ansistring64:
|
|
|
|
+ {$else}
|
|
st_ansistring:
|
|
st_ansistring:
|
|
|
|
+ {$endif}
|
|
begin
|
|
begin
|
|
{ an ansi string looks like a pchar easy !! }
|
|
{ an ansi string looks like a pchar easy !! }
|
|
charst:=tstoreddef(cchartype.def).numberstring;
|
|
charst:=tstoreddef(cchartype.def).numberstring;
|
|
@@ -1459,7 +1519,11 @@ implementation
|
|
tstoreddef(u32inttype.def).concatstabto(asmlist);
|
|
tstoreddef(u32inttype.def).concatstabto(asmlist);
|
|
{$EndIf}
|
|
{$EndIf}
|
|
end;
|
|
end;
|
|
|
|
+ {$ifdef ansistring_bits}
|
|
|
|
+ st_ansistring16,st_ansistring32,st_ansistring64:
|
|
|
|
+ {$else}
|
|
st_ansistring:
|
|
st_ansistring:
|
|
|
|
+ {$endif}
|
|
tstoreddef(cchartype.def).concatstabto(asmlist);
|
|
tstoreddef(cchartype.def).concatstabto(asmlist);
|
|
st_widestring:
|
|
st_widestring:
|
|
tstoreddef(cwidechartype.def).concatstabto(asmlist);
|
|
tstoreddef(cwidechartype.def).concatstabto(asmlist);
|
|
@@ -1471,14 +1535,24 @@ implementation
|
|
|
|
|
|
function tstringdef.needs_inittable : boolean;
|
|
function tstringdef.needs_inittable : boolean;
|
|
begin
|
|
begin
|
|
|
|
+ {$ifdef ansistring_bits}
|
|
|
|
+ needs_inittable:=string_typ in [st_ansistring16,st_ansistring32,st_ansistring64,st_widestring];
|
|
|
|
+ {$else}
|
|
needs_inittable:=string_typ in [st_ansistring,st_widestring];
|
|
needs_inittable:=string_typ in [st_ansistring,st_widestring];
|
|
|
|
+ {$endif}
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
function tstringdef.gettypename : string;
|
|
function tstringdef.gettypename : string;
|
|
|
|
+{$ifdef ansistring_bits}
|
|
|
|
+ const
|
|
|
|
+ names : array[tstringtype] of string[20] = ('',
|
|
|
|
+ 'shortstring','longstring','ansistring16','ansistring32','ansistring64','widestring');
|
|
|
|
+{$else}
|
|
const
|
|
const
|
|
names : array[tstringtype] of string[20] = ('',
|
|
names : array[tstringtype] of string[20] = ('',
|
|
'ShortString','LongString','AnsiString','WideString');
|
|
'ShortString','LongString','AnsiString','WideString');
|
|
|
|
+{$endif}
|
|
begin
|
|
begin
|
|
gettypename:=names[string_typ];
|
|
gettypename:=names[string_typ];
|
|
end;
|
|
end;
|
|
@@ -1487,11 +1561,29 @@ implementation
|
|
procedure tstringdef.write_rtti_data(rt:trttitype);
|
|
procedure tstringdef.write_rtti_data(rt:trttitype);
|
|
begin
|
|
begin
|
|
case string_typ of
|
|
case string_typ of
|
|
|
|
+ {$ifdef ansistring_bits}
|
|
|
|
+ st_ansistring16:
|
|
|
|
+ begin
|
|
|
|
+ rttiList.concat(Tai_const.Create_8bit(tkA16String));
|
|
|
|
+ write_rtti_name;
|
|
|
|
+ end;
|
|
|
|
+ st_ansistring32:
|
|
|
|
+ begin
|
|
|
|
+ rttiList.concat(Tai_const.Create_8bit(tkA32String));
|
|
|
|
+ write_rtti_name;
|
|
|
|
+ end;
|
|
|
|
+ st_ansistring64:
|
|
|
|
+ begin
|
|
|
|
+ rttiList.concat(Tai_const.Create_8bit(tkA64String));
|
|
|
|
+ write_rtti_name;
|
|
|
|
+ end;
|
|
|
|
+ {$else}
|
|
st_ansistring:
|
|
st_ansistring:
|
|
begin
|
|
begin
|
|
rttiList.concat(Tai_const.Create_8bit(tkAString));
|
|
rttiList.concat(Tai_const.Create_8bit(tkAString));
|
|
write_rtti_name;
|
|
write_rtti_name;
|
|
end;
|
|
end;
|
|
|
|
+ {$endif}
|
|
st_widestring:
|
|
st_widestring:
|
|
begin
|
|
begin
|
|
rttiList.concat(Tai_const.Create_8bit(tkWString));
|
|
rttiList.concat(Tai_const.Create_8bit(tkWString));
|
|
@@ -6073,7 +6165,10 @@ implementation
|
|
end.
|
|
end.
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.234 2004-04-18 15:22:24 florian
|
|
|
|
|
|
+ Revision 1.235 2004-04-29 19:56:37 daniel
|
|
|
|
+ * Prepare compiler infrastructure for multiple ansistring types
|
|
|
|
+
|
|
|
|
+ Revision 1.234 2004/04/18 15:22:24 florian
|
|
+ location support for arguments, currently PowerPC/MorphOS only
|
|
+ location support for arguments, currently PowerPC/MorphOS only
|
|
|
|
|
|
Revision 1.233 2004/03/23 22:34:49 peter
|
|
Revision 1.233 2004/03/23 22:34:49 peter
|