2
0
Эх сурвалжийг харах

* moved inclusion of sysos.inc higher up in system.inc, so that
cgeneric.inc can use the C types
* imports of C routines in cgeneric.inc now use C types

git-svn-id: trunk@8816 -

Jonas Maebe 18 жил өмнө
parent
commit
6121df1f67
2 өөрчлөгдсөн 21 нэмэгдсэн , 18 устгасан
  1. 6 6
      rtl/inc/cgeneric.inc
  2. 15 12
      rtl/inc/system.inc

+ 6 - 6
rtl/inc/cgeneric.inc

@@ -21,7 +21,7 @@
 
 {$ifndef FPC_SYSTEM_HAS_MOVE}
 {$define FPC_SYSTEM_HAS_MOVE}
-procedure bcopy(const source;var dest;count:sizeuint); cdecl; external 'c' name 'bcopy';
+procedure bcopy(const source;var dest;count:size_t); 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:sizeint); [public, alias: 'FPC_MOVE'];{$ifdef SYSTEMINLINE}inline;{$endif}
@@ -35,7 +35,7 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_FILLCHAR}
 {$define FPC_SYSTEM_HAS_FILLCHAR}
-procedure memset(var x; value: byte; count: sizeuint); cdecl; external 'c';
+procedure memset(var x; value: byte; count: size_t); cdecl; external 'c';
 
 Procedure FillChar(var x;count: sizeint;value:byte);{$ifdef SYSTEMINLINE}inline;{$endif}
 begin
@@ -49,7 +49,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_INDEXBYTE}
 {$define FPC_SYSTEM_HAS_INDEXBYTE}
 
-function memchr(const buf; b: sizeuint; len: cardinal): pointer; cdecl; external 'c';
+function memchr(const buf; b: cint; len: size_t): pointer; cdecl; external 'c';
 
 function IndexByte(Const buf;len:sizeint;b:byte):sizeint;{$ifdef SYSTEMINLINE}inline;{$endif}
 var
@@ -71,7 +71,7 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_COMPAREBYTE}
 {$define FPC_SYSTEM_HAS_COMPAREBYTE}
-function memcmp_comparechar(Const buf1,buf2;len:sizeuint):longint; cdecl; external 'c' name 'memcmp';
+function memcmp_comparechar(Const buf1,buf2;len:size_t):cint; cdecl; external 'c' name 'memcmp';
 
 function CompareByte(Const buf1,buf2;len:sizeint):sizeint;{$ifdef SYSTEMINLINE}inline;{$endif}
 var
@@ -92,7 +92,7 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_COMPARECHAR0}
 {$define FPC_SYSTEM_HAS_COMPARECHAR0}
-function strncmp_comparechar0(Const buf1,buf2;len:sizeuint):longint; cdecl; external 'c' name 'strncmp';
+function strncmp_comparechar0(Const buf1,buf2;len:size_t):longint; cdecl; external 'c' name 'strncmp';
 
 function CompareChar0(Const buf1,buf2;len:sizeint):sizeint;{$ifdef SYSTEMINLINE}inline;{$endif}
 begin
@@ -108,7 +108,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH}
 {$define FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH}
 
-function libc_pchar_length(p:pchar):sizeuint; cdecl; external 'c' name 'strlen';
+function libc_pchar_length(p:pchar):size_t; cdecl; external 'c' name 'strlen';
 
 function fpc_pchar_length(p:pchar):longint;[public,alias:'FPC_PCHAR_LENGTH']; compilerproc;
 begin

+ 15 - 12
rtl/inc/system.inc

@@ -60,6 +60,21 @@ var
 function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt; forward;
 {$endif FPC_HAS_FEATURE_STACKCHECK}
 
+{*****************************************************************************
+                       OS dependent Helpers/Syscalls
+*****************************************************************************}
+
+{ for some OSes do_isdevice is defined in sysos.inc, but for others (win32)
+  it isn't, and is used before the actual definition is encountered         }
+
+{$ifdef FPC_HAS_FEATURE_FILEIO}
+function do_isdevice(handle:thandle):boolean;forward;
+{$endif FPC_HAS_FEATURE_FILEIO}
+
+
+{$i sysos.inc}
+
+
 {****************************************************************************
                     Include processor specific routines
 ****************************************************************************}
@@ -893,11 +908,6 @@ begin
 end;
 
 
-{$ifdef FPC_HAS_FEATURE_FILEIO}
-function do_isdevice(handle:thandle):boolean;forward;
-{$endif FPC_HAS_FEATURE_FILEIO}
-
-
 {$ifdef FPC_HAS_FEATURE_CONSOLEIO}
 Procedure dump_stack(var f : text;bp : Pointer);
 var
@@ -1146,13 +1156,6 @@ end;
 {$endif}
 
 
-{*****************************************************************************
-                       OS dependent Helpers/Syscalls
-*****************************************************************************}
-
-{$i sysos.inc}
-
-
 {*****************************************************************************
                                Heap
 *****************************************************************************}