diff --git a/rtl/inc/astrings.inc b/rtl/inc/astrings.inc index beef6d4a84..7ef49249f5 100644 --- a/rtl/inc/astrings.inc +++ b/rtl/inc/astrings.inc @@ -1190,6 +1190,30 @@ end; {$endif CPU64} +{$if defined(CPU16) or defined(CPU8)} +Procedure fpc_AnsiStr_LongWord(v : LongWord;Len : SizeInt; out S : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING});[Public,Alias : 'FPC_ANSISTR_LONGWORD']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF} +Var + SS : ShortString; +begin + str(v:Len,SS); + S:=SS; + {$ifdef FPC_HAS_CPSTRING} + SetCodePage(s,cp,false); + {$endif FPC_HAS_CPSTRING} +end; + +Procedure fpc_AnsiStr_LongInt(v : LongInt; Len : SizeInt; out S : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING});[Public,Alias : 'FPC_ANSISTR_LONGINT']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF} +Var + SS : ShortString; +begin + str (v:Len,SS); + S:=SS; + {$ifdef FPC_HAS_CPSTRING} + SetCodePage(s,cp,false); + {$endif FPC_HAS_CPSTRING} +end; +{$endif CPU16 or CPU8} + Procedure Delete(Var S : RawByteString; Index,Size: SizeInt); Var LS : SizeInt; diff --git a/rtl/inc/compproc.inc b/rtl/inc/compproc.inc index b00832afdc..da4776b2f6 100644 --- a/rtl/inc/compproc.inc +++ b/rtl/inc/compproc.inc @@ -125,6 +125,25 @@ procedure fpc_AnsiStr_Currency(c : currency;len,fr : SizeInt;out s : RawByteStri procedure fpc_UnicodeStr_int64(v : int64;len : SizeInt;out s : UnicodeString); compilerproc; {$endif FPC_HAS_FEATURE_WIDESTRINGS} {$endif CPU64} +{$if defined(CPU16) or defined(CPU8)} + procedure fpc_shortstr_longword(v : longword;len : SizeInt;out s : shortstring); compilerproc; + procedure fpc_shortstr_longint(v : longint;len : SizeInt;out s : shortstring); compilerproc; + procedure fpc_chararray_longword(v : longword;len : SizeInt;out a : array of char); compilerproc; + procedure fpc_chararray_longint(v : longint;len : SizeInt;out a : array of char); compilerproc; + {$ifdef FPC_HAS_FEATURE_ANSISTRINGS} + procedure fpc_ansistr_longword(v : longword;len : SizeInt;out s : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc; + procedure fpc_ansistr_longint(v : longint;len : SizeInt;out s : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc; + {$endif FPC_HAS_FEATURE_ANSISTRINGS} + + {$ifdef FPC_HAS_FEATURE_WIDESTRINGS} + {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} + procedure fpc_widestr_longword(v : longword;len : SizeInt;out s : widestring); compilerproc; + procedure fpc_widestr_longint(v : longint;len : SizeInt;out s : widestring); compilerproc; + {$endif ndef FPC_WIDESTRING_EQUAL_UNICODESTRING} + procedure fpc_UnicodeStr_longword(v : longword;len : SizeInt;out s : UnicodeString); compilerproc; + procedure fpc_UnicodeStr_longint(v : longint;len : SizeInt;out s : UnicodeString); compilerproc; + {$endif FPC_HAS_FEATURE_WIDESTRINGS} +{$endif CPU16 or CPU8} {$ifdef FPC_HAS_FEATURE_WIDESTRINGS} {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} {$ifndef FPUNONE} diff --git a/rtl/inc/sstrings.inc b/rtl/inc/sstrings.inc index 2adf56618f..9b8e0707b0 100644 --- a/rtl/inc/sstrings.inc +++ b/rtl/inc/sstrings.inc @@ -448,6 +448,23 @@ end; {$endif CPU64} +{$if defined(CPU16) or defined(CPU8)} +procedure fpc_shortstr_longword(v : longword;len : SizeInt;out s : shortstring);[public,alias:'FPC_SHORTSTR_LONGWORD']; compilerproc; +begin + int_str_unsigned(v,s); + if length(s)