Răsfoiți Sursa

* use ctypes instead of defining own types

git-svn-id: trunk@5918 -
florian 18 ani în urmă
părinte
comite
f7da932aa4
4 a modificat fișierele cu 39 adăugiri și 44 ștergeri
  1. 7 8
      rtl/netware/initc.pp
  2. 8 9
      rtl/netwlibc/initc.pp
  3. 15 16
      rtl/unix/initc.pp
  4. 9 11
      rtl/win32/initc.pp

+ 7 - 8
rtl/netware/initc.pp

@@ -14,24 +14,23 @@
  **********************************************************************}
 unit initc;
 interface
+uses
+  ctypes;
 {$i nwsys.inc}
 
-type libcint   = longint;
-     plibcint = ^libcint;
+function fpgetCerrno:cint;
+procedure fpsetCerrno(err:cint);
 
-function fpgetCerrno:libcint;
-procedure fpsetCerrno(err:libcint);
-
-property cerrno:libcint read fpgetCerrno write fpsetcerrno;
+property cerrno:cint read fpgetCerrno write fpsetcerrno;
 
 implementation
 
-function fpgetCerrno:libcint;
+function fpgetCerrno:cint;
 begin
   fpgetCerrno:=__get_errno_ptr^;
 end;
 
-procedure fpsetCerrno(err:libcint);
+procedure fpsetCerrno(err:cint);
 begin
   __get_errno_ptr^:=err;
 end;

+ 8 - 9
rtl/netwlibc/initc.pp

@@ -15,28 +15,27 @@
 unit initc;
 
 interface
+uses
+  ctypes;
 
-type libcint   = longint;
-     plibcint = ^libcint;
+function fpgetCerrno:cint;
+procedure fpsetCerrno(err:cint);
 
-function fpgetCerrno:libcint;
-procedure fpsetCerrno(err:libcint);
-
-property cerrno:libcint read fpgetCerrno write fpsetcerrno;
+property cerrno:cint read fpgetCerrno write fpsetcerrno;
 
 implementation
 
 const clib = 'libc';
 
-function geterrnolocation: Plibcint; cdecl;external clib name '___errno';
+function geterrnolocation: pcint; cdecl;external clib name '___errno';
 
-function fpgetCerrno:libcint;
+function fpgetCerrno:cint;
 
 begin
   fpgetCerrno:=geterrnolocation^;
 end;
 
-procedure fpsetCerrno(err:libcint);
+procedure fpsetCerrno(err:cint);
 begin
   geterrnolocation^:=err;
 end;

+ 15 - 16
rtl/unix/initc.pp

@@ -15,15 +15,14 @@
  **********************************************************************}
 unit initc;
 interface
+uses
+  ctypes;
 {$linklib c}
 
-type libcint   = longint;
-     plibcint = ^libcint;
+function fpgetCerrno:cint;
+procedure fpsetCerrno(err:cint);
 
-function fpgetCerrno:libcint;
-procedure fpsetCerrno(err:libcint);
-
-property cerrno:libcint read fpgetCerrno write fpsetcerrno;
+property cerrno:cint read fpgetCerrno write fpsetcerrno;
 
 const clib = 'c';
 
@@ -37,15 +36,15 @@ implementation
 
 {$ifdef UseOldErrnoDirectLink}
 Var
-  interrno : libcint;external name {$ifdef OpenBSD} '_errno' {$else} 'h_errno'{$endif};
+  interrno : cint;external name {$ifdef OpenBSD} '_errno' {$else} 'h_errno'{$endif};
 
-function fpgetCerrno:libcint;
+function fpgetCerrno:cint;
 
 begin
   fpgetCerrno:=interrno;
 end;
 
-procedure fpsetCerrno(err:libcint);
+procedure fpsetCerrno(err:cint);
 begin
   interrno:=err;
 end;
@@ -53,33 +52,33 @@ end;
 
 
 {$ifdef Linux}
-function geterrnolocation: Plibcint; cdecl;external clib name '__errno_location';
+function geterrnolocation: pcint; cdecl;external clib name '__errno_location';
 {$endif}
 
 {$ifdef FreeBSD} // tested on x86
-function geterrnolocation: Plibcint; cdecl;external clib name '__error';
+function geterrnolocation: pcint; cdecl;external clib name '__error';
 {$endif}
 
 {$ifdef NetBSD} // from a sparc dump.
-function geterrnolocation: Plibcint; cdecl;external clib name '__errno';
+function geterrnolocation: pcint; cdecl;external clib name '__errno';
 {$endif}
 
 {$ifdef Darwin}
-function geterrnolocation: Plibcint; cdecl;external clib name '__error';
+function geterrnolocation: pcint; cdecl;external clib name '__error';
 {$endif}
 
 
 {$ifdef SunOS}
-function geterrnolocation: Plibcint; cdecl;external clib name '___errno';
+function geterrnolocation: pcint; cdecl;external clib name '___errno';
 {$endif}
 
-function fpgetCerrno:libcint;
+function fpgetCerrno:cint;
 
 begin
   fpgetCerrno:=geterrnolocation^;
 end;
 
-procedure fpsetCerrno(err:libcint);
+procedure fpsetCerrno(err:cint);
 begin
   geterrnolocation^:=err;
 end;

+ 9 - 11
rtl/win32/initc.pp

@@ -14,27 +14,25 @@
 unit initc;
 
 interface
+uses
+  ctypes;
+  
+function fpgetCerrno:cint;
+procedure fpsetCerrno(err:cint);
 
-type
- libcint   = longint;
- plibcint = ^libcint;
-
-function fpgetCerrno:libcint;
-procedure fpsetCerrno(err:libcint);
-
-property cerrno:libcint read fpgetCerrno write fpsetcerrno;
+property cerrno:cint read fpgetCerrno write fpsetcerrno;
 
 
 implementation
 
-function geterrnolocation: Plibcint; cdecl;external 'cygwin1.dll' name '__errno';
+function geterrnolocation: pcint; cdecl;external 'cygwin1.dll' name '__errno';
 
-function fpgetCerrno:libcint;
+function fpgetCerrno:cint;
 begin
   fpgetCerrno:=geterrnolocation^;
 end;
 
-procedure fpsetCerrno(err:libcint);
+procedure fpsetCerrno(err:cint);
 begin
   geterrnolocation^:=err;
 end;