From ea8118b37c56048644184fb9e2c40a5626737347 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 5 Oct 2002 14:20:16 +0000 Subject: [PATCH] * fpc_pchar_length compilerproc and strlen alias --- rtl/i386/i386.inc | 9 ++++++--- rtl/inc/compproc.inc | 7 ++++++- rtl/inc/generic.inc | 14 ++++++++++---- rtl/powerpc/powerpc.inc | 9 ++++++--- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/rtl/i386/i386.inc b/rtl/i386/i386.inc index 534cb8e986..a0cb524e17 100644 --- a/rtl/i386/i386.inc +++ b/rtl/i386/i386.inc @@ -918,8 +918,8 @@ end; function fpc_pchar_to_shortstr(p:pchar):shortstring;[public,alias:'FPC_PCHAR_TO_SHORTSTR']; {$ifdef hascompilerproc} compilerproc; {$endif} {$include strpas.inc} -{$define FPC_SYSTEM_HAS_STRLEN} -function strlen(p:pchar):longint;assembler; +{$define FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH} +function fpc_pchar_length(p:pchar):longint;assembler;[public,alias:'FPC_PCHAR_LENGTH']; {$ifdef hascompilerproc} compilerproc; {$endif} {$include strlen.inc} {$define FPC_SYSTEM_HAS_FPC_CHARARRAY_TO_SHORTSTR} @@ -1174,7 +1174,10 @@ procedure inclocked(var l : longint);assembler; { $Log$ - Revision 1.31 2002-10-02 18:21:51 peter + Revision 1.32 2002-10-05 14:20:16 peter + * fpc_pchar_length compilerproc and strlen alias + + Revision 1.31 2002/10/02 18:21:51 peter * Copy() changed to internal function calling compilerprocs * FPC_SHORTSTR_COPY renamed to FPC_SHORTSTR_ASSIGN because of the new copy functions diff --git a/rtl/inc/compproc.inc b/rtl/inc/compproc.inc index 7aa800fc6a..fcf0ce407d 100644 --- a/rtl/inc/compproc.inc +++ b/rtl/inc/compproc.inc @@ -42,7 +42,9 @@ procedure fpc_Shortstr_SetLength(var s:shortstring;len:StrLenInt); compilerproc; function fpc_shortstr_to_shortstr(len:longint; const sstr: shortstring): shortstring; compilerproc; function fpc_shortstr_concat(const s1,s2:shortstring): shortstring; compilerproc; function fpc_shortstr_compare(const dstr,sstr:shortstring) : longint; compilerproc; + function fpc_pchar_to_shortstr(p:pchar):shortstring; compilerproc; +function fpc_pchar_length(p:pchar):longint; compilerproc; function fpc_chararray_to_shortstr(const arr: array of char):shortstring; compilerproc; function fpc_shortstr_to_chararray(arraysize: longint; const src: ShortString): fpc_big_chararray; compilerproc; @@ -265,7 +267,10 @@ function fpc_qword_to_double(q: qword): double; compilerproc; { $Log$ - Revision 1.24 2002-10-02 18:21:51 peter + Revision 1.25 2002-10-05 14:20:16 peter + * fpc_pchar_length compilerproc and strlen alias + + Revision 1.24 2002/10/02 18:21:51 peter * Copy() changed to internal function calling compilerprocs * FPC_SHORTSTR_COPY renamed to FPC_SHORTSTR_ASSIGN because of the new copy functions diff --git a/rtl/inc/generic.inc b/rtl/inc/generic.inc index 6f767d3ab5..a174b3e123 100644 --- a/rtl/inc/generic.inc +++ b/rtl/inc/generic.inc @@ -642,6 +642,9 @@ end; { also add a strpas alias for internal use in the system unit (JM) } function strpas(p:pchar):shortstring; [external name 'FPC_PCHAR_TO_SHORTSTR']; +{ also add a strlen alias for internal use in the system unit (JM) } +function strlen(p:pchar):longint; [external name 'FPC_PCHAR_LENGTH']; + {$ifndef FPC_SYSTEM_HAS_FPC_CHARARRAY_TO_SHORTSTR} {$ifdef hascompilerproc} @@ -733,9 +736,9 @@ end; {$endif hascompilerproc} -{$ifndef FPC_SYSTEM_HAS_STRLEN} +{$ifndef FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH} -function strlen(p:pchar):longint; +function fpc_pchar_length(p:pchar):longint;assembler;[public,alias:'FPC_PCHAR_LENGTH']; {$ifdef hascompilerproc} compilerproc; {$endif} var i : longint; begin i:=0; @@ -743,7 +746,7 @@ begin exit(i); end; -{$endif ndef FPC_SYSTEM_HAS_STRLEN} +{$endif ndef FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH} {**************************************************************************** Caller/StackFrame Helpers @@ -924,7 +927,10 @@ end; {$endif ndef FPC_SYSTEM_HAS_INT_STR_LONGWORD} { $Log$ - Revision 1.38 2002-10-02 18:21:51 peter + Revision 1.39 2002-10-05 14:20:16 peter + * fpc_pchar_length compilerproc and strlen alias + + Revision 1.38 2002/10/02 18:21:51 peter * Copy() changed to internal function calling compilerprocs * FPC_SHORTSTR_COPY renamed to FPC_SHORTSTR_ASSIGN because of the new copy functions diff --git a/rtl/powerpc/powerpc.inc b/rtl/powerpc/powerpc.inc index fffd89e94a..a2755578a5 100644 --- a/rtl/powerpc/powerpc.inc +++ b/rtl/powerpc/powerpc.inc @@ -853,8 +853,8 @@ assembler; {$include strpas.inc} -{$define FPC_SYSTEM_HAS_STRLEN} -function strlen(p:pchar):longint;assembler; +{$define FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH} +function fpc_pchar_length(p:pchar):longint;assembler;[public,alias:'FPC_PCHAR_LENGTH']; {$ifdef hascompilerproc} compilerproc; {$endif} {$include strlen.inc} @@ -964,7 +964,10 @@ end ['R3','R10']; { $Log$ - Revision 1.21 2002-10-02 18:21:52 peter + Revision 1.22 2002-10-05 14:20:16 peter + * fpc_pchar_length compilerproc and strlen alias + + Revision 1.21 2002/10/02 18:21:52 peter * Copy() changed to internal function calling compilerprocs * FPC_SHORTSTR_COPY renamed to FPC_SHORTSTR_ASSIGN because of the new copy functions