+ ansistr_to_shortstr and vice versa stub helpers

git-svn-id: branches/jvmbackend@18564 -
This commit is contained in:
Jonas Maebe 2011-08-20 08:10:54 +00:00
parent 6374b473ff
commit baad29373e
2 changed files with 17 additions and 7 deletions

View File

@ -218,14 +218,17 @@ begin
end; end;
{$else FPC_STRTOSHORTSTRINGPROC} {$else FPC_STRTOSHORTSTRINGPROC}
*)
procedure fpc_AnsiStr_To_ShortStr (out res: shortstring; const S2 : Ansistring);[Public, alias: 'FPC_ANSISTR_TO_SHORTSTR']; compilerproc; procedure fpc_AnsiStr_To_ShortStr (out res: shortstring; const S2 : Ansistring);[Public, alias: 'FPC_ANSISTR_TO_SHORTSTR']; compilerproc;
{ {
Converts a AnsiString to a ShortString; Converts a AnsiString to a ShortString;
} }
(*
Var Var
Size : SizeInt; Size : SizeInt;
*)
begin begin
(*
if S2='' then if S2='' then
res:='' res:=''
else else
@ -236,24 +239,29 @@ begin
Move (S2[1],res[1],Size); Move (S2[1],res[1],Size);
byte(res[0]):=byte(Size); byte(res[0]):=byte(Size);
end; end;
*)
end; end;
(*
{$endif FPC_STRTOSHORTSTRINGPROC} {$endif FPC_STRTOSHORTSTRINGPROC}
*)
Function fpc_ShortStr_To_AnsiStr (Const S2 : ShortString): ansistring; compilerproc; Function fpc_ShortStr_To_AnsiStr (Const S2 : ShortString): ansistring; compilerproc;
{ {
Converts a ShortString to a AnsiString; Converts a ShortString to a AnsiString;
} }
(*
Var Var
Size : SizeInt; Size : SizeInt;
*)
begin begin
(*
Size:=Length(S2); Size:=Length(S2);
Setlength (fpc_ShortStr_To_AnsiStr,Size); Setlength (fpc_ShortStr_To_AnsiStr,Size);
if Size>0 then if Size>0 then
Move(S2[1],Pointer(fpc_ShortStr_To_AnsiStr)^,Size); Move(S2[1],Pointer(fpc_ShortStr_To_AnsiStr)^,Size);
end;
*) *)
end;
Function fpc_Char_To_AnsiStr(const c : AnsiChar): AnsiString; compilerproc; Function fpc_Char_To_AnsiStr(const c : AnsiChar): AnsiString; compilerproc;
{ {

View File

@ -259,10 +259,12 @@ Procedure fpc_AnsiStr_ShortStr_Concat (Var S1: AnsiString; Var S2 : ShortString)
{$ifndef FPC_STRTOSHORTSTRINGPROC} {$ifndef FPC_STRTOSHORTSTRINGPROC}
function fpc_AnsiStr_To_ShortStr (high_of_res: SizeInt;const S2 : Ansistring): shortstring; compilerproc; function fpc_AnsiStr_To_ShortStr (high_of_res: SizeInt;const S2 : Ansistring): shortstring; compilerproc;
{$else FPC_STRTOSHORTSTRINGPROC} {$else FPC_STRTOSHORTSTRINGPROC}
procedure fpc_AnsiStr_To_ShortStr (out res : shortstring;const S2 : Ansistring); compilerproc;
{$endif FPC_STRTOSHORTSTRINGPROC}
Function fpc_ShortStr_To_AnsiStr (Const S2 : ShortString): ansistring; compilerproc;
*) *)
procedure fpc_AnsiStr_To_ShortStr (out res : shortstring;const S2 : Ansistring); compilerproc;
(*
{$endif FPC_STRTOSHORTSTRINGPROC}
*)
Function fpc_ShortStr_To_AnsiStr (Const S2 : ShortString): ansistring; compilerproc;
{$ifndef nounsupported} {$ifndef nounsupported}
Function fpc_Char_To_AnsiStr(const c : AnsiChar): AnsiString; compilerproc; Function fpc_Char_To_AnsiStr(const c : AnsiChar): AnsiString; compilerproc;
{$endif} {$endif}