|
@@ -15,15 +15,14 @@
|
|
**********************************************************************}
|
|
**********************************************************************}
|
|
unit initc;
|
|
unit initc;
|
|
interface
|
|
interface
|
|
|
|
+uses
|
|
|
|
+ ctypes;
|
|
{$linklib c}
|
|
{$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';
|
|
const clib = 'c';
|
|
|
|
|
|
@@ -37,15 +36,15 @@ implementation
|
|
|
|
|
|
{$ifdef UseOldErrnoDirectLink}
|
|
{$ifdef UseOldErrnoDirectLink}
|
|
Var
|
|
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
|
|
begin
|
|
fpgetCerrno:=interrno;
|
|
fpgetCerrno:=interrno;
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure fpsetCerrno(err:libcint);
|
|
|
|
|
|
+procedure fpsetCerrno(err:cint);
|
|
begin
|
|
begin
|
|
interrno:=err;
|
|
interrno:=err;
|
|
end;
|
|
end;
|
|
@@ -53,33 +52,33 @@ end;
|
|
|
|
|
|
|
|
|
|
{$ifdef Linux}
|
|
{$ifdef Linux}
|
|
-function geterrnolocation: Plibcint; cdecl;external clib name '__errno_location';
|
|
|
|
|
|
+function geterrnolocation: pcint; cdecl;external clib name '__errno_location';
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
{$ifdef FreeBSD} // tested on x86
|
|
{$ifdef FreeBSD} // tested on x86
|
|
-function geterrnolocation: Plibcint; cdecl;external clib name '__error';
|
|
|
|
|
|
+function geterrnolocation: pcint; cdecl;external clib name '__error';
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
{$ifdef NetBSD} // from a sparc dump.
|
|
{$ifdef NetBSD} // from a sparc dump.
|
|
-function geterrnolocation: Plibcint; cdecl;external clib name '__errno';
|
|
|
|
|
|
+function geterrnolocation: pcint; cdecl;external clib name '__errno';
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
{$ifdef Darwin}
|
|
{$ifdef Darwin}
|
|
-function geterrnolocation: Plibcint; cdecl;external clib name '__error';
|
|
|
|
|
|
+function geterrnolocation: pcint; cdecl;external clib name '__error';
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
|
|
|
|
{$ifdef SunOS}
|
|
{$ifdef SunOS}
|
|
-function geterrnolocation: Plibcint; cdecl;external clib name '___errno';
|
|
|
|
|
|
+function geterrnolocation: pcint; cdecl;external clib name '___errno';
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
-function fpgetCerrno:libcint;
|
|
|
|
|
|
+function fpgetCerrno:cint;
|
|
|
|
|
|
begin
|
|
begin
|
|
fpgetCerrno:=geterrnolocation^;
|
|
fpgetCerrno:=geterrnolocation^;
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure fpsetCerrno(err:libcint);
|
|
|
|
|
|
+procedure fpsetCerrno(err:cint);
|
|
begin
|
|
begin
|
|
geterrnolocation^:=err;
|
|
geterrnolocation^:=err;
|
|
end;
|
|
end;
|