From 05458e5c3975af74f9b50f7e90b212ed9ff6b7d9 Mon Sep 17 00:00:00 2001 From: marco Date: Thu, 11 Dec 2003 09:21:52 +0000 Subject: [PATCH] * patch from peter --- fcl/inc/resolve.pp | 6 ++++-- fcl/unix/resolve.inc | 3 +++ rtl/win32/initc.pp | 26 +++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/fcl/inc/resolve.pp b/fcl/inc/resolve.pp index 06aaec2569..0d946a05c9 100644 --- a/fcl/inc/resolve.pp +++ b/fcl/inc/resolve.pp @@ -215,7 +215,6 @@ Implementation {$ifdef usenetdb} uses netdb; {$else} -uses initc; {$i resolve.inc} {$endif} @@ -951,7 +950,10 @@ Finalization end. { $Log$ - Revision 1.5 2003-12-10 15:50:50 marco + Revision 1.6 2003-12-11 09:23:50 marco + * patch from peter + + Revision 1.5 2003/12/10 15:50:50 marco * fpgetcerrno introduction Revision 1.4 2003/05/17 21:52:37 michael diff --git a/fcl/unix/resolve.inc b/fcl/unix/resolve.inc index 53ebf2758c..b3a48cdbec 100644 --- a/fcl/unix/resolve.inc +++ b/fcl/unix/resolve.inc @@ -1,3 +1,6 @@ +uses + initc; + const { Net type } socklib = 'c'; diff --git a/rtl/win32/initc.pp b/rtl/win32/initc.pp index 0a3a832ca5..c040038af3 100644 --- a/rtl/win32/initc.pp +++ b/rtl/win32/initc.pp @@ -5,6 +5,8 @@ unit initc; interface +type libcint = longint; + plibcint = ^libcint; {$LINKLIB cygwin} {$linklib kernel32} @@ -12,6 +14,12 @@ interface { this unit is just ment to run startup code to get C code to work correctly PM } +function fpgetCerrno:libcint; +procedure fpsetCerrno(err:libcint); + +{$ifndef ver1_0} +property cerrno:libcint read fpgetCerrno write fpsetcerrno; +{$endif} implementation @@ -20,6 +28,19 @@ uses {$i textrec.inc} +const clib = 'crtdll'; + +function geterrnolocation: Plibcint; cdecl;external clib name '__error'; + +function fpgetCerrno:libcint; +begin + fpgetCerrno:=geterrnolocation^; +end; + +procedure fpsetCerrno(err:libcint); +begin + geterrnolocation^:=err; +end; procedure cygwin_crt0(p : pointer);cdecl;external; @@ -105,7 +126,10 @@ if setjmp(exitjmpbuf)=0 then end. { $Log$ - Revision 1.9 2003-11-03 09:42:28 marco + Revision 1.10 2003-12-11 09:21:52 marco + * patch from peter + + Revision 1.9 2003/11/03 09:42:28 marco * Peter's Cardinal<->Longint fixes patch Revision 1.8 2003/09/08 18:25:45 peter