Просмотр исходного кода

+ cgeneric.inc: implementations of rtl routines based on libc
* system.inc: include cgeneric.inc before powerpc.inc/i386.inc/... if
FPC_USE_LIBC is defined
* powerpc.inc, i386.inc: check whether the routines they implement aren't
implemented yet in another include file (cgeneric.inc)

Jonas Maebe 22 лет назад
Родитель
Сommit
5439babeb5
4 измененных файлов с 246 добавлено и 6 удалено
  1. 45 1
      rtl/i386/i386.inc
  2. 147 0
      rtl/inc/cgeneric.inc
  3. 13 1
      rtl/inc/system.inc
  4. 41 4
      rtl/powerpc/powerpc.inc

+ 45 - 1
rtl/i386/i386.inc

@@ -31,6 +31,7 @@ asm
   ret
 end;
 
+{$ifndef FPC_SYSTEM_HAS_MOVE}
 {$define FPC_SYSTEM_HAS_MOVE}
 procedure Move(const source;var dest;count:longint);assembler;
 var
@@ -111,8 +112,10 @@ asm
         movl    saveedi,%edi
         movl    saveesi,%esi
 end;
+{$endif FPC_SYSTEM_HAS_MOVE}
 
 
+{$ifndef FPC_SYSTEM_HAS_FILLCHAR}
 {$define FPC_SYSTEM_HAS_FILLCHAR}
 Procedure FillChar(var x;count:longint;value:byte);assembler;
 var
@@ -157,8 +160,10 @@ asm
 .LFillEnd:
         movl    saveedi,%edi
 end;
+{$endif FPC_SYSTEM_HAS_FILLCHAR}
 
 
+{$ifndef FPC_SYSTEM_HAS_FILLWORD}
 {$define FPC_SYSTEM_HAS_FILLWORD}
 procedure fillword(var x;count : longint;value : word);assembler;
 var
@@ -192,8 +197,10 @@ asm
 .LFillWordEnd:
         movl    saveedi,%edi
 end;
+{$endif FPC_SYSTEM_HAS_FILLWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_FILLDWORD}
 {$define FPC_SYSTEM_HAS_FILLDWORD}
 procedure filldword(var x;count : longint;value : dword);assembler;
 var
@@ -218,8 +225,10 @@ asm
 .LFillDWordEnd:
         movl    saveedi,%edi
 end;
+{$endif FPC_SYSTEM_HAS_FILLDWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_INDEXBYTE}
 {$define FPC_SYSTEM_HAS_INDEXBYTE}
 function IndexByte(Const buf;len:longint;b:byte):longint; assembler;
 var
@@ -249,8 +258,10 @@ asm
         movl    saveedi,%edi
         movl    saveebx,%ebx
 end;
+{$endif FPC_SYSTEM_HAS_FILLDWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_INDEXWORD}
 {$define FPC_SYSTEM_HAS_INDEXWORD}
 function Indexword(Const buf;len:longint;b:word):longint; assembler;
 var
@@ -280,8 +291,10 @@ asm
         movl    saveedi,%edi
         movl    saveebx,%ebx
 end;
+{$endif FPC_SYSTEM_HAS_INDEXWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_INDEXDWORD}
 {$define FPC_SYSTEM_HAS_INDEXDWORD}
 function IndexDWord(Const buf;len:longint;b:DWord):longint; assembler;
 var
@@ -317,8 +330,10 @@ asm
         movl    saveedi,%edi
         movl    saveebx,%ebx
 end;
+{$endif FPC_SYSTEM_HAS_INDEXDWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_COMPAREBYTE}
 {$define FPC_SYSTEM_HAS_COMPAREBYTE}
 function CompareByte(Const buf1,buf2;len:longint):longint; assembler;
 var
@@ -371,9 +386,11 @@ asm
         movl    saveedi,%edi
         movl    saveesi,%esi
 end;
+{$endif FPC_SYSTEM_HAS_COMPAREBYTE}
 
 
 
+{$ifndef FPC_SYSTEM_HAS_COMPAREWORD}
 {$define FPC_SYSTEM_HAS_COMPAREWORD}
 function CompareWord(Const buf1,buf2;len:longint):longint; assembler;
 var
@@ -438,8 +455,10 @@ asm
         movl    saveesi,%esi
         movl    saveebx,%ebx
 end;
+{$endif FPC_SYSTEM_HAS_COMPAREWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_COMPAREDWORD}
 {$define FPC_SYSTEM_HAS_COMPAREDWORD}
 function CompareDWord(Const buf1,buf2;len:longint):longint; assembler;
 var
@@ -502,8 +521,10 @@ asm
         movl    saveesi,%esi
         movl    saveebx,%ebx
 end;
+{$endif FPC_SYSTEM_HAS_COMPAREDWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_INDEXCHAR0}
 {$define FPC_SYSTEM_HAS_INDEXCHAR0}
 function IndexChar0(Const buf;len:longint;b:Char):longint; assembler;
 var
@@ -542,6 +563,7 @@ asm
         movl    saveesi,%esi
         movl    saveebx,%ebx
 end;
+{$endif FPC_SYSTEM_HAS_INDEXCHAR0}
 
 
 {****************************************************************************
@@ -874,6 +896,7 @@ end;
                                  String
 ****************************************************************************}
 
+{$ifndef FPC_SYSTEM_HAS_FPC_SHORTSTR_ASSIGN}
 {$define FPC_SYSTEM_HAS_FPC_SHORTSTR_ASSIGN}
 
 function fpc_shortstr_to_shortstr(len:longint; const sstr: shortstring): shortstring; [public,alias: 'FPC_SHORTSTR_TO_SHORTSTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
@@ -910,6 +933,7 @@ begin
   end ['ESI','EDI','EAX','ECX'];
 end;
 
+
 {$ifdef interncopy}
 procedure fpc_shortstr_assign(len:longint;sstr,dstr:pointer);[public,alias:'FPC_SHORTSTR_ASSIGN'];
 {$else}
@@ -951,7 +975,10 @@ begin
         popl    %eax
   end ['ESI','EDI'];
 end;
+{$endif FPC_SYSTEM_HAS_FPC_SHORTSTR_ASSIGN}
+
 
+{$ifndef FPC_SYSTEM_HAS_FPC_SHORTSTR_CONCAT}
 {$define FPC_SYSTEM_HAS_FPC_SHORTSTR_CONCAT}
 
 function fpc_shortstr_concat(const s1,s2:shortstring):shortstring;{$ifdef hascompilerproc}compilerproc;{$endif}
@@ -1009,8 +1036,10 @@ begin
         movsb
   end ['EBX','ECX','EAX','ESI','EDI'];
 end;
+{$endif FPC_SYSTEM_HAS_FPC_SHORTSTR_CONCAT}
 
 
+{$ifndef FPC_SYSTEM_HAS_FPC_SHORTSTR_APPEND_SHORTSTR}
 {$define FPC_SYSTEM_HAS_FPC_SHORTSTR_APPEND_SHORTSTR}
 
 {$ifdef hascompilerproc}
@@ -1090,8 +1119,10 @@ begin
   end ['EBX','ECX','EAX','ESI','EDI'];
 end;
 {$endif hascompilerproc}
+{$endif FPC_SYSTEM_HAS_FPC_SHORTSTR_APPEND_SHORTSTR}
 
 
+{$ifndef FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE}
 {$define FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE}
 function fpc_shortstr_compare(const left,right:shortstring): longint; [public,alias:'FPC_SHORTSTR_COMPARE']; {$ifdef hascompilerproc} compilerproc; {$endif}
 begin
@@ -1140,15 +1171,21 @@ begin
 .LStrCmp3:
   end ['EDX','ECX','EBX','EAX','ESI','EDI'];
 end;
+{$endif FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE}
 
 
+{$ifndef FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
 {$define FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
 function fpc_pchar_to_shortstr(p:pchar):shortstring;assembler;[public,alias:'FPC_PCHAR_TO_SHORTSTR']; {$ifdef hascompilerproc} compilerproc; {$endif}
 {$include strpas.inc}
+{$endif FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
+
 
+{$ifndef FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH}
 {$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}
+{$endif FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH}
 
 
 {$define FPC_SYSTEM_HAS_GET_FRAME}
@@ -1418,7 +1455,14 @@ end;
 
 {
   $Log$
-  Revision 1.57  2004-01-02 17:22:14  jonas
+  Revision 1.58  2004-01-11 11:10:07  jonas
+    + cgeneric.inc: implementations of rtl routines based on libc
+    * system.inc: include cgeneric.inc before powerpc.inc/i386.inc/... if
+      FPC_USE_LIBC is defined
+    * powerpc.inc, i386.inc: check whether the routines they implement aren't
+      implemented yet in another include file (cgeneric.inc)
+
+  Revision 1.57  2004/01/02 17:22:14  jonas
     + fpc_cpuinit procedure to allow cpu/fpu initialisation before any unit
       initialises
     + fpu exceptions for invalid operations and division by zero enabled for

+ 147 - 0
rtl/inc/cgeneric.inc

@@ -0,0 +1,147 @@
+{
+    $Id$
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by the Free Pascal development team.
+
+    Processor independent implementation for the system unit
+    (based on libc)
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+
+{****************************************************************************
+                               Primitives
+****************************************************************************}
+
+{$ifndef FPC_SYSTEM_HAS_MOVE}
+{$define FPC_SYSTEM_HAS_MOVE}
+procedure bcopy(const source;var dest;count:cardinal); cdecl; external 'c' name 'bcopy';
+
+{ we need this separate move declaration because we can't add a "public, alias" to the above }
+procedure Move(const source;var dest;count:longint); [public, alias: 'FPC_MOVE'];{$ifdef SYSTEMINLINE}inline;{$endif}
+begin
+  if count <= 0 then
+    exit;
+  bcopy(source,dest,count);
+end;
+{$endif not FPC_SYSTEM_HAS_MOVE}
+
+
+{$ifndef FPC_SYSTEM_HAS_FILLCHAR}
+{$define FPC_SYSTEM_HAS_FILLCHAR}
+procedure memset(var x; value: byte; count: cardinal); cdecl; external 'c';
+
+Procedure FillChar(var x;count: longint;value:byte);{$ifdef SYSTEMINLINE}inline;{$endif}
+begin
+  if count <= 0 then
+    exit;
+  memset(x,value,count);
+end;
+{$endif FPC_SYSTEM_HAS_FILLCHAR}
+
+
+{$ifndef FPC_SYSTEM_HAS_FILLBYTE}
+{$define FPC_SYSTEM_HAS_FILLBYTE}
+procedure FillByte (var x;count : longint;value : byte );{$ifdef SYSTEMINLINE}inline;{$endif}
+begin
+  if count <= 0 then
+    exit;
+  FillChar (X,Count,CHR(VALUE));
+end;
+{$endif not FPC_SYSTEM_HAS_FILLBYTE}
+
+
+{$ifndef FPC_SYSTEM_HAS_INDEXCHAR}
+{$define FPC_SYSTEM_HAS_INDEXCHAR}
+
+function memchr(const buf; b: longint; len: cardinal): pointer; cdecl; external 'c';
+
+function IndexChar(Const buf;len:longint;b:char):longint;
+var
+  res: pointer;
+begin
+  if len = 0 then
+    exit(-1);
+  { simulate assembler implementations behaviour, which is expected }
+  { fpc_pchar_to_ansistr in astrings.inc (interpret values < 0 as   }
+  { unsigned)                                                       }
+  res := memchr(buf,longint(b),cardinal(len));
+  if (res <> nil) then
+    IndexChar := longint(res-@buf)
+  else
+    IndexChar := -1;
+end;
+{$endif not FPC_SYSTEM_HAS_INDEXCHAR}
+
+
+{$ifndef FPC_SYSTEM_HAS_INDEXBYTE}
+{$define FPC_SYSTEM_HAS_INDEXBYTE}
+function IndexByte(Const buf;len:longint;b:byte):longint;{$ifdef SYSTEMINLINE}inline;{$endif}
+begin
+  IndexByte:=IndexChar(buf,len,char(b));
+end;
+{$endif not FPC_SYSTEM_HAS_INDEXBYTE}
+
+
+{$ifndef FPC_SYSTEM_HAS_COMPARECHAR}
+{$define FPC_SYSTEM_HAS_COMPARECHAR}
+function memcmp_comparechar(Const buf1,buf2;len:cardinal):longint; cdecl; external 'c' name 'memcmp';
+
+function CompareChar(Const buf1,buf2;len:longint):longint;
+var
+  res: longint;
+begin
+  if len <= 0 then
+    exit(0);
+  res := memcmp_comparechar(buf1,buf2,len);
+  if res < 0 then
+    CompareChar := -1
+  else if res > 0 then
+    CompareChar := 1
+  else
+    CompareChar := 0;
+end;
+{$endif not FPC_SYSTEM_HAS_COMPARECHAR}
+
+
+{$ifndef FPC_SYSTEM_HAS_COMPAREBYTE}
+{$define FPC_SYSTEM_HAS_COMPAREBYTE}
+function CompareByte(Const buf1,buf2;len:longint):longint;{$ifdef SYSTEMINLINE}inline;{$endif}
+begin
+  CompareByte := CompareChar(buf1,buf2,len);
+end;
+{$endif not FPC_SYSTEM_HAS_COMPAREBYTE}
+
+
+{$ifndef FPC_SYSTEM_HAS_COMPARECHAR0}
+{$define FPC_SYSTEM_HAS_COMPARECHAR0}
+function strncmp_comparechar0(Const buf1,buf2;len:cardinal):longint; cdecl; external 'c' name 'strncmp';
+
+function CompareChar0(Const buf1,buf2;len:longint):longint;
+begin
+  if len <= 0 then
+    exit(0);
+  strncmp_comparechar0(buf1,buf2,len);
+end;
+
+{$endif not FPC_SYSTEM_HAS_COMPARECHAR0}
+
+
+{
+  $Log$
+  Revision 1.1  2004-01-11 11:10:07  jonas
+    + cgeneric.inc: implementations of rtl routines based on libc
+    * system.inc: include cgeneric.inc before powerpc.inc/i386.inc/... if
+      FPC_USE_LIBC is defined
+    * powerpc.inc, i386.inc: check whether the routines they implement aren't
+      implemented yet in another include file (cgeneric.inc)
+
+
+}

+ 13 - 1
rtl/inc/system.inc

@@ -81,6 +81,11 @@ Procedure Rewrite(var f : TypedFile); [INTERNPROC: In_Rewrite_TypedFile];
                     Include processor specific routines
 ****************************************************************************}
 
+{$ifdef FPC_USE_LIBC}
+{ prefer libc implementations over our own, as they're most likely faster }
+{$i libcproc.inc}
+{$endif FPC_USE_LIBC}
+
 {$ifdef cpui386}
   {$ifdef SYSPROCDEFINED}
     {$Error Can't determine processor type !}
@@ -859,7 +864,14 @@ end;
 
 {
   $Log$
-  Revision 1.49  2004-01-02 17:21:50  jonas
+  Revision 1.50  2004-01-11 11:10:07  jonas
+    + cgeneric.inc: implementations of rtl routines based on libc
+    * system.inc: include cgeneric.inc before powerpc.inc/i386.inc/... if
+      FPC_USE_LIBC is defined
+    * powerpc.inc, i386.inc: check whether the routines they implement aren't
+      implemented yet in another include file (cgeneric.inc)
+
+  Revision 1.49  2004/01/02 17:21:50  jonas
     + fpc_cpuinit procedure to allow cpu/fpu initialisation before any unit
       initialises
     + fpu exceptions for invalid operations and division by zero enabled for

+ 41 - 4
rtl/powerpc/powerpc.inc

@@ -210,8 +210,8 @@ end;
                                 Move / Fill
 ****************************************************************************}
 
+{$ifndef FPC_SYSTEM_HAS_MOVE}
 {$define FPC_SYSTEM_HAS_MOVE}
-
 procedure Move(const source;var dest;count:longint);[public, alias: 'FPC_MOVE'];assembler;
 asm
           {  count <= 0 ?  }
@@ -433,8 +433,10 @@ asm
           bdnz    .LMoveBytesLoop
 .LMoveDone:
 end;
+{$endif FPC_SYSTEM_HAS_MOVE}
 
 
+{$ifndef FPC_SYSTEM_HAS_FILLCHAR}
 {$define FPC_SYSTEM_HAS_FILLCHAR}
 
 Procedure FillChar(var x;count:longint;value:byte);assembler;
@@ -569,8 +571,10 @@ asm
         bdnz      .LFillCharVerySmallLoop
 .LFillCharDone:
 end;
+{$endif FPC_SYSTEM_HAS_FILLCHAR}
 
 
+{$ifndef FPC_SYSTEM_HAS_FILLDWORD}
 {$define FPC_SYSTEM_HAS_FILLDWORD}
 procedure filldword(var x;count : longint;value : dword);
 assembler;
@@ -589,8 +593,10 @@ asm
                 bdnz    .LFillDWordLoop
 .LFillDWordEnd:
 end;
+{$endif FPC_SYSTEM_HAS_FILLDWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_INDEXBYTE}
 {$define FPC_SYSTEM_HAS_INDEXBYTE}
 function IndexByte(const buf;len:longint;b:byte):longint; assembler;
 { input: r3 = buf, r4 = len, r5 = b                   }
@@ -614,8 +620,10 @@ asm
                 sub     r3,r10,r0
 .LIndexByteDone:
 end;
+{$endif FPC_SYSTEM_HAS_INDEXBYTE}
 
 
+{$ifndef FPC_SYSTEM_HAS_INDEXWORD}
 {$define FPC_SYSTEM_HAS_INDEXWORD}
 function IndexWord(const buf;len:longint;b:word):longint; assembler;
 { input: r3 = buf, r4 = len, r5 = b                   }
@@ -640,8 +648,10 @@ asm
                 srawi   r3,r3,1
 .LIndexWordDone:
 end;
+{$endif FPC_SYSTEM_HAS_INDEXWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_INDEXDWORD}
 {$define FPC_SYSTEM_HAS_INDEXDWORD}
 function IndexDWord(const buf;len:longint;b:DWord):longint; assembler;
 { input: r3 = buf, r4 = len, r5 = b                   }
@@ -666,7 +676,10 @@ asm
                 srawi   r3,r3,2
 .LIndexDWordDone:
 end;
+{$endif FPC_SYSTEM_HAS_INDEXDWORD}
+
 
+{$ifndef FPC_SYSTEM_HAS_COMPAREBYTE}
 {$define FPC_SYSTEM_HAS_COMPAREBYTE}
 function CompareByte(const buf1,buf2;len:longint):longint; assembler;
 { input: r3 = buf1, r4 = buf2, r5 = len                           }
@@ -692,7 +705,10 @@ asm
         bdnzt   cr0*4+eq, .LCompByteLoop
 .LCompByteDone:
 end;
+{$endif FPC_SYSTEM_HAS_COMPAREBYTE}
 
+
+{$ifndef FPC_SYSTEM_HAS_COMPAREWORD}
 {$define FPC_SYSTEM_HAS_COMPAREWORD}
 function CompareWord(const buf1,buf2;len:longint):longint; assembler;
 { input: r3 = buf1, r4 = buf2, r5 = len                           }
@@ -718,8 +734,10 @@ asm
         bdnzt   cr0*4+eq, .LCompWordLoop
 .LCompWordDone:
 end;
+{$endif FPC_SYSTEM_HAS_COMPAREWORD}
 
 
+{$ifndef FPC_SYSTEM_HAS_COMPAREDWORD}
 {$define FPC_SYSTEM_HAS_COMPAREDWORD}
 function CompareDWord(const buf1,buf2;len:longint):longint; assembler;
 { input: r3 = buf1, r4 = buf2, r5 = len                           }
@@ -745,7 +763,10 @@ asm
         bdnzt   cr0*4+eq, .LCompDWordLoop
 .LCompDWordDone:
 end;
+{$endif FPC_SYSTEM_HAS_COMPAREDWORD}
+
 
+{$ifndef FPC_SYSTEM_HAS_INDEXCHAR0}
 {$define FPC_SYSTEM_HAS_INDEXCHAR0}
 function IndexChar0(const buf;len:longint;b:Char):longint; assembler;
 { input: r3 = buf, r4 = len, r5 = b                         }
@@ -772,13 +793,15 @@ asm
         sub     r3,r9,r0
 .LIndexChar0Done:
 end;
+{$endif FPC_SYSTEM_HAS_INDEXCHAR0}
 
 
 {****************************************************************************
                                  String
 ****************************************************************************}
 
-{$define FPC_SYSTEM_HAS_FPC_SHORTSTR_COPY}
+{$ifndef FPC_SYSTEM_HAS_FPC_SHORTSTR_ASSIGN}
+{$define FPC_SYSTEM_HAS_FPC_SHORTSTR_ASSIGN}
 function fpc_shortstr_to_shortstr(len:longint; const sstr: shortstring): shortstring; [public,alias: 'FPC_SHORTSTR_TO_SHORTSTR']; compilerproc;
 assembler;
 { input: r3: pointer to result, r4: len, r5: sstr }
@@ -807,7 +830,6 @@ asm
 end;
 
 
-{$define FPC_SYSTEM_HAS_FPC_SHORTSTR_ASSIGN}
 {$ifdef interncopy}
 procedure fpc_shortstr_assign(len:longint;sstr,dstr:pointer);[public,alias:'FPC_SHORTSTR_ASSIGN'];
 {$else}
@@ -838,8 +860,10 @@ asm
         bdnz    .LShortStrCopyLoop2
 .LShortStrCopyDone2:
 end;
+{$endif FPC_SYSTEM_HAS_FPC_SHORTSTR_ASSIGN}
 
 
+{$ifndef FPC_SYSTEM_HAS_FPC_SHORTSTR_APPEND_SHORTSTR}
 {$define FPC_SYSTEM_HAS_FPC_SHORTSTR_APPEND_SHORTSTR}
 
 procedure fpc_shortstr_append_shortstr(var s1: shortstring; const s2: shortstring); compilerproc;
@@ -881,6 +905,7 @@ asm
       bdnz    .LShortStrAppendLoop
 .LShortStrAppendDone:
 end;
+{$endif FPC_SYSTEM_HAS_FPC_SHORTSTR_APPEND_SHORTSTR}
 
 (*
 {$define FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE}
@@ -942,15 +967,20 @@ LShortStrCompareDone:
 end;
 *)
 
+
+{$ifndef FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
 {$define FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
 function fpc_pchar_to_shortstr(p:pchar):shortstring;[public,alias:'FPC_PCHAR_TO_SHORTSTR']; compilerproc;
 assembler;
 {$include strpas.inc}
+{$endif FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
 
 
+{$ifndef FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH}
 {$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}
+{$endif FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH}
 
 
 {$define FPC_SYSTEM_HAS_GET_FRAME}
@@ -1061,7 +1091,14 @@ end;
 
 {
   $Log$
-  Revision 1.64  2004-01-10 00:16:20  jonas
+  Revision 1.65  2004-01-11 11:10:07  jonas
+    + cgeneric.inc: implementations of rtl routines based on libc
+    * system.inc: include cgeneric.inc before powerpc.inc/i386.inc/... if
+      FPC_USE_LIBC is defined
+    * powerpc.inc, i386.inc: check whether the routines they implement aren't
+      implemented yet in another include file (cgeneric.inc)
+
+  Revision 1.64  2004/01/10 00:16:20  jonas
     * fixed mtfsb0 instruction for assembler reader/writer
     * fixed initialisation of fpscr register to avoid spurious SIGPFE's
       (uses mtfsb0 instruction, so added extra define in options.pas to avoid