Selaa lähdekoodia

* add typecasts for oldlinuxstat

peter 22 vuotta sitten
vanhempi
commit
7acb66b1a3
3 muutettua tiedostoa jossa 22 lisäystä ja 12 poistoa
  1. 11 7
      rtl/unix/linuxold.inc
  2. 5 2
      rtl/unix/liunsysc.inc
  3. 6 3
      rtl/unix/timezone.inc

+ 11 - 7
rtl/unix/linuxold.inc

@@ -5,10 +5,10 @@
    BSD parts (c) 2000 by Marco van de Voort
    BSD parts (c) 2000 by Marco van de Voort
    members of the Free Pascal development team.
    members of the Free Pascal development team.
 
 
-   The old 1.0.x linux unit fixed to work under 1.1.x. 
+   The old 1.0.x linux unit fixed to work under 1.1.x.
    At the moment the errorhandling can be different.
    At the moment the errorhandling can be different.
    Probably it won't be supported for anything else then FreeBSD
    Probably it won't be supported for anything else then FreeBSD
-   and Linux/i386. 
+   and Linux/i386.
 
 
    See the file COPYING.FPC, included in this distribution,
    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.
    for details about the copyright.
@@ -44,12 +44,13 @@ Uses BaseUnix,Unix;
 {$I signal.inc}
 {$I signal.inc}
 
 
 {$ifdef linux}
 {$ifdef linux}
-{$IFNDEF VER1_0}		// ugly voodoo. Sacrifice a chicken and hope
-				// that it works.
+{$IFNDEF VER1_0}                // ugly voodoo. Sacrifice a chicken and hope
+                                // that it works.
 Type stat=baseunix.tstat;
 Type stat=baseunix.tstat;
 {$ELSE}
 {$ELSE}
 type
 type
 {$I stat.inc}
 {$I stat.inc}
+{$define oldlinuxstat}
 {$ENDIF}
 {$ENDIF}
 {$ELSE}
 {$ELSE}
 Type stat=baseunix.tstat;
 Type stat=baseunix.tstat;
@@ -1081,7 +1082,7 @@ end;
 Function Sys_Stat(Filename:pchar;var Buffer: stat):longint;
 Function Sys_Stat(Filename:pchar;var Buffer: stat):longint;
 
 
 begin
 begin
- Sys_stat:=fpstat(filename,buffer); 
+ Sys_stat:=fpstat(filename,{$ifdef oldlinuxstat}baseunix.stat(buffer){$else}buffer{$endif});
  linuxerror:=fpgeterrno;
  linuxerror:=fpgeterrno;
 end;
 end;
 
 
@@ -1509,7 +1510,7 @@ begin
      fpseterrno(ESysEBadf);
      fpseterrno(ESysEBadf);
      exit;
      exit;
    end;
    end;
- {$ifndef bsd}                         
+ {$ifndef bsd}
   {$ifndef Solaris}
   {$ifndef Solaris}
   p^.dd_nextoff:=Sys_lseek(p^.dd_fd,off,seek_set);
   p^.dd_nextoff:=Sys_lseek(p^.dd_fd,off,seek_set);
   {$endif}
   {$endif}
@@ -3130,7 +3131,10 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  2003-09-16 15:40:31  marco
+  Revision 1.6  2003-09-16 16:06:02  peter
+    * add typecasts for oldlinuxstat
+
+  Revision 1.5  2003/09/16 15:40:31  marco
    * voodoo is now linux only
    * voodoo is now linux only
 
 
   Revision 1.4  2003/09/16 15:39:31  marco
   Revision 1.4  2003/09/16 15:39:31  marco

+ 5 - 2
rtl/unix/liunsysc.inc

@@ -313,7 +313,7 @@ Function Fstat(Fd:Longint;var Info:stat):Boolean;
   Get all information on a file descriptor, and return it in info.
   Get all information on a file descriptor, and return it in info.
 }
 }
 begin
 begin
-  FStat:=fpfstat(fd,info)=0;
+  FStat:=fpfstat(fd,{$ifdef oldlinuxstat}baseunix.stat(info){$else}info{$endif})=0;
   LinuxError:=fpgetErrno;
   LinuxError:=fpgetErrno;
 end;
 end;
 
 
@@ -636,7 +636,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2003-09-15 21:07:41  marco
+  Revision 1.3  2003-09-16 16:06:02  peter
+    * add typecasts for oldlinuxstat
+
+  Revision 1.2  2003/09/15 21:07:41  marco
    * second round of linux fixes. oldlinux now works
    * second round of linux fixes. oldlinux now works
 
 
   Revision 1.1  2003/09/15 20:30:49  marco
   Revision 1.1  2003/09/15 20:30:49  marco

+ 6 - 3
rtl/unix/timezone.inc

@@ -252,10 +252,10 @@ begin
     GetTimezoneFile:=s;
     GetTimezoneFile:=s;
     end
     end
   // Try SuSE
   // Try SuSE
-  else if fpstat(TimeZoneFile,info)>=0 then
+  else if fpstat(TimeZoneFile,{$ifdef oldlinuxstat}baseunix.stat(info){$else}info{$endif})>=0 then
     GetTimeZoneFile:=TimeZoneFile
     GetTimeZoneFile:=TimeZoneFile
   // Try RedHat
   // Try RedHat
-  else If fpstat(AltTimeZoneFile,Info)>=0 then
+  else If fpstat(AltTimeZoneFile,{$ifdef oldlinuxstat}baseunix.stat(info){$else}info{$endif})>=0 then
       GetTimeZoneFile:=AltTimeZoneFile;
       GetTimeZoneFile:=AltTimeZoneFile;
 end;
 end;
 
 
@@ -286,7 +286,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2003-09-14 20:15:01  marco
+  Revision 1.5  2003-09-16 16:06:02  peter
+    * add typecasts for oldlinuxstat
+
+  Revision 1.4  2003/09/14 20:15:01  marco
    * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
    * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
 
 
   Revision 1.3  2002/09/07 16:01:28  peter
   Revision 1.3  2002/09/07 16:01:28  peter