Selaa lähdekoodia

* patch from peter

marco 21 vuotta sitten
vanhempi
commit
05458e5c39
3 muutettua tiedostoa jossa 32 lisäystä ja 3 poistoa
  1. 4 2
      fcl/inc/resolve.pp
  2. 3 0
      fcl/unix/resolve.inc
  3. 25 1
      rtl/win32/initc.pp

+ 4 - 2
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

+ 3 - 0
fcl/unix/resolve.inc

@@ -1,3 +1,6 @@
+uses
+  initc;
+  
 const
   { Net type }
   socklib = 'c';

+ 25 - 1
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