diff --git a/compiler/globtype.pas b/compiler/globtype.pas index 68e3ce7502..239c750875 100644 --- a/compiler/globtype.pas +++ b/compiler/globtype.pas @@ -29,6 +29,11 @@ interface maxidlen = 64; type +{$ifdef ver1_0} + { Bootstrapping } + PtrInt = DWord; + SizeInt = Longint; +{$endif ver1_0} { Switches which can be changed locally } tlocalswitch = (cs_localnone, @@ -242,7 +247,10 @@ implementation end. { $Log$ - Revision 1.53 2004-04-29 19:56:36 daniel + Revision 1.54 2004-05-02 11:48:46 peter + * strlenint is replaced with sizeint + + Revision 1.53 2004/04/29 19:56:36 daniel * Prepare compiler infrastructure for multiple ansistring types Revision 1.52 2004/04/28 15:19:03 florian diff --git a/compiler/widestr.pas b/compiler/widestr.pas index f86b98d7cb..c1444f2081 100644 --- a/compiler/widestr.pas +++ b/compiler/widestr.pas @@ -27,7 +27,7 @@ unit widestr; interface uses - charset + charset,globtype {$ifdef delphi} ,sysutils {$endif} @@ -38,7 +38,7 @@ unit widestr; tcompilerwidechar = word; tcompilerwidecharptr = ^tcompilerwidechar; {$ifdef delphi} - strlenint = integer; + sizeint = integer; { delphi doesn't allow pointer accessing as array } tcompilerwidechararray = array[0..0] of tcompilerwidechar; pcompilerwidechar = ^tcompilerwidechararray; @@ -49,22 +49,22 @@ unit widestr; pcompilerwidestring = ^_tcompilerwidestring; _tcompilerwidestring = record data : pcompilerwidechar; - maxlen,len : StrLenInt; + maxlen,len : sizeint; end; procedure initwidestring(var r : pcompilerwidestring); procedure donewidestring(var r : pcompilerwidestring); - procedure setlengthwidestring(r : pcompilerwidestring;l : StrLenInt); - function getlengthwidestring(r : pcompilerwidestring) : StrLenInt; + procedure setlengthwidestring(r : pcompilerwidestring;l : sizeint); + function getlengthwidestring(r : pcompilerwidestring) : sizeint; procedure concatwidestringchar(r : pcompilerwidestring;c : tcompilerwidechar); procedure concatwidestrings(s1,s2 : pcompilerwidestring); - function comparewidestrings(s1,s2 : pcompilerwidestring) : StrLenInt; + function comparewidestrings(s1,s2 : pcompilerwidestring) : sizeint; procedure copywidestring(s,d : pcompilerwidestring); function asciichar2unicode(c : char) : tcompilerwidechar; function unicode2asciichar(c : tcompilerwidechar) : char; - procedure ascii2unicode(p : pchar;l : StrLenInt;r : pcompilerwidestring); + procedure ascii2unicode(p : pchar;l : sizeint;r : pcompilerwidestring); procedure unicode2ascii(r : pcompilerwidestring;p : pchar); - function getcharwidestring(r : pcompilerwidestring;l : StrLenInt) : tcompilerwidechar; + function getcharwidestring(r : pcompilerwidestring;l : sizeint) : tcompilerwidechar; function cpavailable(const s : string) : boolean; implementation @@ -92,19 +92,19 @@ unit widestr; r:=nil; end; - function getcharwidestring(r : pcompilerwidestring;l : StrLenInt) : tcompilerwidechar; + function getcharwidestring(r : pcompilerwidestring;l : sizeint) : tcompilerwidechar; begin getcharwidestring:=r^.data[l]; end; - function getlengthwidestring(r : pcompilerwidestring) : StrLenInt; + function getlengthwidestring(r : pcompilerwidestring) : sizeint; begin getlengthwidestring:=r^.len; end; - procedure setlengthwidestring(r : pcompilerwidestring;l : StrLenInt); + procedure setlengthwidestring(r : pcompilerwidestring;l : sizeint); begin if r^.maxlen>=l then @@ -139,9 +139,9 @@ unit widestr; move(s^.data^,d^.data^,s^.len*sizeof(tcompilerwidechar)); end; - function comparewidestrings(s1,s2 : pcompilerwidestring) : StrLenInt; + function comparewidestrings(s1,s2 : pcompilerwidestring) : sizeint; var - maxi,temp : StrLenInt; + maxi,temp : sizeint; begin if pointer(s1)=pointer(s2) then begin @@ -153,7 +153,7 @@ unit widestr; if maxi>temp then maxi:=Temp; {$ifdef Delphi} - temp:=strlenint(comparemem(@s1^.data,@s2^.data,maxi)); + temp:=sizeint(comparemem(@s1^.data,@s2^.data,maxi)); {$else} temp:=compareword(s1^.data^,s2^.data^,maxi); {$endif} @@ -177,11 +177,11 @@ unit widestr; unicode2asciichar:=#0; end; - procedure ascii2unicode(p : pchar;l : StrLenInt;r : pcompilerwidestring); + procedure ascii2unicode(p : pchar;l : sizeint;r : pcompilerwidestring); var source : pchar; dest : tcompilerwidecharptr; - i : StrLenInt; + i : sizeint; m : punicodemap; begin m:=getmap(aktsourcecodepage); @@ -240,7 +240,10 @@ unit widestr; end. { $Log$ - Revision 1.12 2002-10-05 12:43:29 carl + Revision 1.13 2004-05-02 11:48:46 peter + * strlenint is replaced with sizeint + + Revision 1.12 2002/10/05 12:43:29 carl * fixes for Delphi 6 compilation (warning : Some features do not work under Delphi)