Browse Source

* Unix Renamefest for defines.

marco 25 years ago
parent
commit
1253f86267
4 changed files with 75 additions and 42 deletions
  1. 6 3
      api/inc/apicomm.pas
  2. 30 27
      api/inc/filesys.pas
  3. 6 3
      api/inc/keyboard.pas
  4. 33 9
      api/inc/platform.inc

+ 6 - 3
api/inc/apicomm.pas

@@ -1,4 +1,4 @@
-{****************************************************************************
+****************************************************************************
 
    $Id$
 
@@ -73,7 +73,7 @@ const
     enclosed in IFDEFs. (The reason is that not always you can't always decide
     which error-code belongs to one unit or the other) }
 
-{$IFDEF OS_Linux}
+{$IFDEF OS_Unix}
   { for a more complete description of each error check /usr/include/asm/errno.h }
   errNotPermitted         =   1;
   errFileNotFound         =   2;
@@ -279,7 +279,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.1  2000-07-13 06:29:38  michael
+  Revision 1.2  2000-11-13 14:35:57  marco
+   * Unix Renamefest for defines.
+
+  Revision 1.1  2000/07/13 06:29:38  michael
   + Initial import
 
   Revision 1.2  2000/07/09 07:41:47  hajny

+ 30 - 27
api/inc/filesys.pas

@@ -47,7 +47,7 @@ uses
  {$endif PPC_FPC}
 {$ENDIF}
 
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
   , linux
 {$ENDIF}
   ;
@@ -64,7 +64,7 @@ const
                   {$ENDIF}
 
   { Character to separate directories in a path }
-  PathSeparator = {$IFDEF OS_Linux}
+  PathSeparator = {$IFDEF OS_Unix}
                   '/';
                   {$ELSE}
                   '\';
@@ -143,10 +143,10 @@ type
     Name             : TFileName;
     Size             : TFileInt;
     { platform-specific fields }
-    {$IFDEF OS_LINUX}
+    {$IFDEF OS_Unix}
     Created          : TDateTime;
     LastAccessed     : TDateTime;
-    {$ENDIF OS_LINUX}
+    {$ENDIF OS_Unix}
   end;
 
   { Search record declaration for FPC for DOS (we're not using the DOS unit
@@ -185,11 +185,11 @@ type
 
     { OS-specific output fields }
 
-    {$IFDEF OS_Linux}
+    {$IFDEF OS_Unix}
     GL : PGlob;
-    {$ELSE OS_Linux}
+    {$ELSE OS_Unix}
     SR      : DOS.SearchRec;
-    {$ENDIF OS_Linux}
+    {$ENDIF OS_Unix}
   end;
 
 procedure CheckDateTime(var DT: TDateTime);
@@ -566,9 +566,9 @@ end;
 
 {$ENDIF} { OS_DOS }
 
-{$IFDEF OS_LINUX}
+{$IFDEF OS_UNIX}
 { Functions and procedures not decalred in interface section,
-  Linux operating system }
+  Unix operating systems }
 
 Procedure EpochToDateTime (Epoch : Longint; var DT : TDateTime);
 { Returns a Checked datetime, starting from a Unix epoch-style time }
@@ -597,7 +597,7 @@ begin
   EpochToDateTime(Info.Ctime,Fd.Created);
   Fd.Size:=Info.size;
 end;
-{$ENDIF} {OS_LINUX}
+{$ENDIF} {OS_Unix}
 
 { Functions and procedures declared in the interface section }
 
@@ -623,7 +623,7 @@ end;
 
 { Continues a file search started by StartSearch }
 procedure ContinueSearch(var FS: TFileSearch);
-{$IFDEF OS_Linux}
+{$IFDEF OS_Unix}
 Var g : PGLob;
     info : stat;
 
@@ -644,7 +644,7 @@ begin
     FS.Success:=True;
     end;
 end;
-{$ELSE OS_Linux}
+{$ELSE OS_Unix}
 begin
   if fs.Success
     then begin
@@ -654,7 +654,7 @@ begin
              then SearchRecToFileDescriptor(fs.sr, fs.fd);
          end;
 end;
-{$ENDIF OS_Linux}
+{$ENDIF OS_Unix}
 
 { Create a new subdirectory AName }
 procedure CreateDir(AName : TFileName);
@@ -689,7 +689,7 @@ end;
 { Returns the full version of AName }
 function ExpandName(AName : TFileName): TFileName;
 begin
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
   ExpandName := Linux.FExpand(AName);
 {$ELSE}
   ExpandName := DOS.FExpand(AName);
@@ -717,7 +717,7 @@ begin
   FileAttrToString := S;
 end;
 {$ELSE OS_DOS}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 var temp : string[9];
     i : longint;
 
@@ -730,11 +730,11 @@ begin
     if (AFileAttr and (1 shl i))=(1 shl I) then temp[9-i]:=full[9-i];
   FileAttrToString := Temp;
 end;
-{$ELSE OS_LINUX}
+{$ELSE OS_Unix}
 begin
   FileAttrToString:='';
 end;
-{$ENDIF OS_LINUX}
+{$ENDIF OS_Unix}
 {$ENDIF OS_DOS}
 
 { Returns a string version of the file integer value fi }
@@ -816,7 +816,7 @@ begin
   ErrorCode := DOS.DOSError;
 end;
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 var
   info : stat;
 begin
@@ -864,7 +864,7 @@ begin
   CheckDateTime(DT);
 end;
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 var info : Stat;
 
 begin
@@ -920,7 +920,7 @@ begin
   IsValidName := true;
 end;
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 begin
   IsVAlidName:=((pos('?',AName)=0) and (pos('*',AName)=0))
 end;
@@ -972,7 +972,7 @@ begin
   ErrorCode := DOS.DOSError;
 end;
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 begin
   Linux.Chmod (Aname,AFileAttr);
   ErrorCode:=LinuxError;
@@ -998,7 +998,7 @@ begin
   ErrorCode := DOS.DOSError;
 end;
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 var
   utim : utimebuf;
 begin
@@ -1015,7 +1015,7 @@ end;
 
 { Starts a file search, using input data from fs }
 procedure StartSearch(var FS: TFileSearch);
-{$IFDEF OS_Linux}
+{$IFDEF OS_Unix}
 var
   info : stat;
 begin
@@ -1030,7 +1030,7 @@ begin
     FS.Success:=True;
     end;
 end;
-{$ELSE OS_Linux}
+{$ELSE OS_Unix}
 { this version works for every platform/os/bits combination that has a
   working DOS unit : BP/FPC/Virtual Pascal }
 begin
@@ -1039,12 +1039,12 @@ begin
   if fs.Success
     then SearchRecToFileDescriptor(FS.SR, FS.FD);
 end;
-{$ENDIF OS_Linux}
+{$ENDIF OS_Unix}
 
 { Terminates a file search }
 procedure TerminateSearch (var FS: TFileSearch);
 begin
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 GlobFree (FS.GL);
 {$ELSE}
   {$IFNDEF PPC_BP}
@@ -1060,7 +1060,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.1  2000-07-13 06:29:38  michael
+  Revision 1.2  2000-11-13 14:35:57  marco
+   * Unix Renamefest for defines.
+
+  Revision 1.1  2000/07/13 06:29:38  michael
   + Initial import
 
   Revision 1.2  2000/02/29 11:43:16  pierre

+ 6 - 3
api/inc/keyboard.pas

@@ -176,9 +176,9 @@ function IsFunctionKey(KeyEvent: TKeyEvent): Boolean;
 {$ifdef win32}
 var last_ir : INPUT_RECORD;
 {$endif win32}
-{$ifdef linux}
+{$ifdef Unix}
 Function RawReadKey:char;
-{$endif linux}
+{$endif unix}
 {$endif DEBUG}
 
 implementation
@@ -234,7 +234,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.2  2000-10-26 23:10:21  peter
+  Revision 1.3  2000-11-13 14:35:57  marco
+   * Unix Renamefest for defines.
+
+  Revision 1.2  2000/10/26 23:10:21  peter
     * fixes merge
 
   Revision 1.1  2000/07/13 06:29:38  michael

+ 33 - 9
api/inc/platform.inc

@@ -24,7 +24,7 @@
    the compiler/platform/target in a consequent way.
 
     OS_XXXX         The operating system used (XXXX may be one of:
-                       DOS, OS2, Linux, Windows, Go32)
+                       DOS, OS2, Linux, Windows, Go32, FreeBSD,Linux)
     PPC_XXXX        The compiler used: BP, FPK, Virtual, Speed
     BIT_XX          The number of bits of the target platform: 16 or 32
     PROC_XXXX       The mode of the target processor (Real or Protected)
@@ -36,7 +36,7 @@
    Changelog:
 
      Date       Version        Who        Comments
-     02 Jul 97  0.1            Bazsi      Initial implementation
+     02 Jul 97  0.1            Bazsi      Initial implementation~
      28 Aug 97  0.2            LdeB       Fixed OS2 platform sort out
      29 Aug 97  0.3            LdeB       Added assembler type change
      29 Aug 97  0.4            LdeB       OS_DOS removed from Windows
@@ -48,7 +48,9 @@
      27 Aug 98  1.0            LdeB       Fixed Atari etc not $UNDEF OS_DOS.
 
      25 Oct 98  1.1            pfv        Delphi4
-
+     13 nov 00  1.2	       mvdv	  Unix renamefest Addition of FreeBSD
+					   and change of Linux conditional
+					   meaning
  ****************************************************************************
 
     This is how the IFDEF and UNDEF statements below should translate.
@@ -64,6 +66,8 @@
 
  LINUX    OS_LINUX    FPC      PPC_FPC      PROC_Protected  BIT_32  ASM_FPC
 
+ FREEBSD  OS_FREEBSD  FPC      PPC_FPC      PROC_Protected  BIT_32  ASM_FPC
+
  WINDOWS  OS_WINDOWS  BP/TP7   PPC_BP       PROC_Protected  BIT_16  ASM_BP
                       DELPHI   PPC_DELPHI   PROC_Protected  BIT_16  ASM_BP
                       DELPHI2  PPC_DELPHI&2 PROC_Protected  BIT_16  ASM_BP
@@ -90,11 +94,17 @@ FOR FPC THESE ARE THE TRANSLATIONS
   PLATFORM  SYSTEM    COMPILER  HANDLE SIZE      ASM          CPU
  --------  ------    --------  -----------      ----         ---
 
- DOS      OS_DOS,OS_GO32 FPC     32-bit           AT&T         CPU86
+ DOS      OS_DOS,
+	  OS_GO32      FPC     32-bit           AT&T         CPU86
 
  WIN32    OS_WINDOWS   FPC     32-bit           AT&T         ----
 
- LINUX    OS_LINUX     FPC     32-bit           AT&T         ----
+ LINUX    OS_LINUX,
+	  OS_UNIX      FPC     32-bit           AT&T         ----
+
+ FREEBSD  OS_FREEBSD, 
+          OS_BSD,
+	  OS_UNIX      FPC     32-bit           AT&T         ----
 
  OS2      OS_OS2       FPC     ?????            AT&T         CPU86
 
@@ -104,6 +114,10 @@ FOR FPC THESE ARE THE TRANSLATIONS
 
  AMIGA    OS_AMIGA     FPC     32-bit           Internal     CPU68
 
+
+Note: All Unices have OS_UNIX in common. All BSD's (Open,Net,Free) have
+      OS_BSD in common.
+
  ****************************************************************************}
 
 {---------------------------------------------------------------------------}
@@ -140,12 +154,19 @@ FOR FPC THESE ARE THE TRANSLATIONS
 {$ENDIF}
 
 {---------------------------------------------------------------------------}
-{  FPC LINUX COMPILER changes operating system - Updated 27Aug98 LdB        }
+{  FPC LINUX COMPILER changes operating system - Updated 12nov00 MvdV       }
 {  Note: Other linux compilers would need to change other details           }
 {---------------------------------------------------------------------------}
-{$IFDEF LINUX}
+{$IFDEF UNIX}
   {$UNDEF OS_DOS}
-  {$DEFINE OS_LINUX}
+  {$DEFINE OS_UNIX}
+  {$IFNDEF BSD}			     {Work around. BSD still defines "linux"
+						            in 1.1 for now} 
+   {$DEFINE OS_LINUX}
+  {$ELSE}
+    {$DEFINE OS_FREEBSD}
+    {$DEFINE OS_BSD}
+  {$ENDIF}
 {$ENDIF}
 
 {---------------------------------------------------------------------------}
@@ -302,7 +323,10 @@ FOR FPC THESE ARE THE TRANSLATIONS
 
 {
   $Log$
-  Revision 1.2  2000-07-13 11:32:24  michael
+  Revision 1.3  2000-11-13 14:35:57  marco
+   * Unix Renamefest for defines.
+
+  Revision 1.2  2000/07/13 11:32:24  michael
   + removed logs
  
 }