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$
    $Id$
 
 
@@ -73,7 +73,7 @@ const
     enclosed in IFDEFs. (The reason is that not always you can't always decide
     enclosed in IFDEFs. (The reason is that not always you can't always decide
     which error-code belongs to one unit or the other) }
     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 }
   { for a more complete description of each error check /usr/include/asm/errno.h }
   errNotPermitted         =   1;
   errNotPermitted         =   1;
   errFileNotFound         =   2;
   errFileNotFound         =   2;
@@ -279,7 +279,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $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
   + Initial import
 
 
   Revision 1.2  2000/07/09 07:41:47  hajny
   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 PPC_FPC}
 {$ENDIF}
 {$ENDIF}
 
 
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
   , linux
   , linux
 {$ENDIF}
 {$ENDIF}
   ;
   ;
@@ -64,7 +64,7 @@ const
                   {$ENDIF}
                   {$ENDIF}
 
 
   { Character to separate directories in a path }
   { Character to separate directories in a path }
-  PathSeparator = {$IFDEF OS_Linux}
+  PathSeparator = {$IFDEF OS_Unix}
                   '/';
                   '/';
                   {$ELSE}
                   {$ELSE}
                   '\';
                   '\';
@@ -143,10 +143,10 @@ type
     Name             : TFileName;
     Name             : TFileName;
     Size             : TFileInt;
     Size             : TFileInt;
     { platform-specific fields }
     { platform-specific fields }
-    {$IFDEF OS_LINUX}
+    {$IFDEF OS_Unix}
     Created          : TDateTime;
     Created          : TDateTime;
     LastAccessed     : TDateTime;
     LastAccessed     : TDateTime;
-    {$ENDIF OS_LINUX}
+    {$ENDIF OS_Unix}
   end;
   end;
 
 
   { Search record declaration for FPC for DOS (we're not using the DOS unit
   { Search record declaration for FPC for DOS (we're not using the DOS unit
@@ -185,11 +185,11 @@ type
 
 
     { OS-specific output fields }
     { OS-specific output fields }
 
 
-    {$IFDEF OS_Linux}
+    {$IFDEF OS_Unix}
     GL : PGlob;
     GL : PGlob;
-    {$ELSE OS_Linux}
+    {$ELSE OS_Unix}
     SR      : DOS.SearchRec;
     SR      : DOS.SearchRec;
-    {$ENDIF OS_Linux}
+    {$ENDIF OS_Unix}
   end;
   end;
 
 
 procedure CheckDateTime(var DT: TDateTime);
 procedure CheckDateTime(var DT: TDateTime);
@@ -566,9 +566,9 @@ end;
 
 
 {$ENDIF} { OS_DOS }
 {$ENDIF} { OS_DOS }
 
 
-{$IFDEF OS_LINUX}
+{$IFDEF OS_UNIX}
 { Functions and procedures not decalred in interface section,
 { Functions and procedures not decalred in interface section,
-  Linux operating system }
+  Unix operating systems }
 
 
 Procedure EpochToDateTime (Epoch : Longint; var DT : TDateTime);
 Procedure EpochToDateTime (Epoch : Longint; var DT : TDateTime);
 { Returns a Checked datetime, starting from a Unix epoch-style time }
 { Returns a Checked datetime, starting from a Unix epoch-style time }
@@ -597,7 +597,7 @@ begin
   EpochToDateTime(Info.Ctime,Fd.Created);
   EpochToDateTime(Info.Ctime,Fd.Created);
   Fd.Size:=Info.size;
   Fd.Size:=Info.size;
 end;
 end;
-{$ENDIF} {OS_LINUX}
+{$ENDIF} {OS_Unix}
 
 
 { Functions and procedures declared in the interface section }
 { Functions and procedures declared in the interface section }
 
 
@@ -623,7 +623,7 @@ end;
 
 
 { Continues a file search started by StartSearch }
 { Continues a file search started by StartSearch }
 procedure ContinueSearch(var FS: TFileSearch);
 procedure ContinueSearch(var FS: TFileSearch);
-{$IFDEF OS_Linux}
+{$IFDEF OS_Unix}
 Var g : PGLob;
 Var g : PGLob;
     info : stat;
     info : stat;
 
 
@@ -644,7 +644,7 @@ begin
     FS.Success:=True;
     FS.Success:=True;
     end;
     end;
 end;
 end;
-{$ELSE OS_Linux}
+{$ELSE OS_Unix}
 begin
 begin
   if fs.Success
   if fs.Success
     then begin
     then begin
@@ -654,7 +654,7 @@ begin
              then SearchRecToFileDescriptor(fs.sr, fs.fd);
              then SearchRecToFileDescriptor(fs.sr, fs.fd);
          end;
          end;
 end;
 end;
-{$ENDIF OS_Linux}
+{$ENDIF OS_Unix}
 
 
 { Create a new subdirectory AName }
 { Create a new subdirectory AName }
 procedure CreateDir(AName : TFileName);
 procedure CreateDir(AName : TFileName);
@@ -689,7 +689,7 @@ end;
 { Returns the full version of AName }
 { Returns the full version of AName }
 function ExpandName(AName : TFileName): TFileName;
 function ExpandName(AName : TFileName): TFileName;
 begin
 begin
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
   ExpandName := Linux.FExpand(AName);
   ExpandName := Linux.FExpand(AName);
 {$ELSE}
 {$ELSE}
   ExpandName := DOS.FExpand(AName);
   ExpandName := DOS.FExpand(AName);
@@ -717,7 +717,7 @@ begin
   FileAttrToString := S;
   FileAttrToString := S;
 end;
 end;
 {$ELSE OS_DOS}
 {$ELSE OS_DOS}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 var temp : string[9];
 var temp : string[9];
     i : longint;
     i : longint;
 
 
@@ -730,11 +730,11 @@ begin
     if (AFileAttr and (1 shl i))=(1 shl I) then temp[9-i]:=full[9-i];
     if (AFileAttr and (1 shl i))=(1 shl I) then temp[9-i]:=full[9-i];
   FileAttrToString := Temp;
   FileAttrToString := Temp;
 end;
 end;
-{$ELSE OS_LINUX}
+{$ELSE OS_Unix}
 begin
 begin
   FileAttrToString:='';
   FileAttrToString:='';
 end;
 end;
-{$ENDIF OS_LINUX}
+{$ENDIF OS_Unix}
 {$ENDIF OS_DOS}
 {$ENDIF OS_DOS}
 
 
 { Returns a string version of the file integer value fi }
 { Returns a string version of the file integer value fi }
@@ -816,7 +816,7 @@ begin
   ErrorCode := DOS.DOSError;
   ErrorCode := DOS.DOSError;
 end;
 end;
 {$ELSE}
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 var
 var
   info : stat;
   info : stat;
 begin
 begin
@@ -864,7 +864,7 @@ begin
   CheckDateTime(DT);
   CheckDateTime(DT);
 end;
 end;
 {$ELSE}
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 var info : Stat;
 var info : Stat;
 
 
 begin
 begin
@@ -920,7 +920,7 @@ begin
   IsValidName := true;
   IsValidName := true;
 end;
 end;
 {$ELSE}
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 begin
 begin
   IsVAlidName:=((pos('?',AName)=0) and (pos('*',AName)=0))
   IsVAlidName:=((pos('?',AName)=0) and (pos('*',AName)=0))
 end;
 end;
@@ -972,7 +972,7 @@ begin
   ErrorCode := DOS.DOSError;
   ErrorCode := DOS.DOSError;
 end;
 end;
 {$ELSE}
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 begin
 begin
   Linux.Chmod (Aname,AFileAttr);
   Linux.Chmod (Aname,AFileAttr);
   ErrorCode:=LinuxError;
   ErrorCode:=LinuxError;
@@ -998,7 +998,7 @@ begin
   ErrorCode := DOS.DOSError;
   ErrorCode := DOS.DOSError;
 end;
 end;
 {$ELSE}
 {$ELSE}
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 var
 var
   utim : utimebuf;
   utim : utimebuf;
 begin
 begin
@@ -1015,7 +1015,7 @@ end;
 
 
 { Starts a file search, using input data from fs }
 { Starts a file search, using input data from fs }
 procedure StartSearch(var FS: TFileSearch);
 procedure StartSearch(var FS: TFileSearch);
-{$IFDEF OS_Linux}
+{$IFDEF OS_Unix}
 var
 var
   info : stat;
   info : stat;
 begin
 begin
@@ -1030,7 +1030,7 @@ begin
     FS.Success:=True;
     FS.Success:=True;
     end;
     end;
 end;
 end;
-{$ELSE OS_Linux}
+{$ELSE OS_Unix}
 { this version works for every platform/os/bits combination that has a
 { this version works for every platform/os/bits combination that has a
   working DOS unit : BP/FPC/Virtual Pascal }
   working DOS unit : BP/FPC/Virtual Pascal }
 begin
 begin
@@ -1039,12 +1039,12 @@ begin
   if fs.Success
   if fs.Success
     then SearchRecToFileDescriptor(FS.SR, FS.FD);
     then SearchRecToFileDescriptor(FS.SR, FS.FD);
 end;
 end;
-{$ENDIF OS_Linux}
+{$ENDIF OS_Unix}
 
 
 { Terminates a file search }
 { Terminates a file search }
 procedure TerminateSearch (var FS: TFileSearch);
 procedure TerminateSearch (var FS: TFileSearch);
 begin
 begin
-{$IFDEF OS_LINUX}
+{$IFDEF OS_Unix}
 GlobFree (FS.GL);
 GlobFree (FS.GL);
 {$ELSE}
 {$ELSE}
   {$IFNDEF PPC_BP}
   {$IFNDEF PPC_BP}
@@ -1060,7 +1060,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $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
   + Initial import
 
 
   Revision 1.2  2000/02/29 11:43:16  pierre
   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}
 {$ifdef win32}
 var last_ir : INPUT_RECORD;
 var last_ir : INPUT_RECORD;
 {$endif win32}
 {$endif win32}
-{$ifdef linux}
+{$ifdef Unix}
 Function RawReadKey:char;
 Function RawReadKey:char;
-{$endif linux}
+{$endif unix}
 {$endif DEBUG}
 {$endif DEBUG}
 
 
 implementation
 implementation
@@ -234,7 +234,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $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
     * fixes merge
 
 
   Revision 1.1  2000/07/13 06:29:38  michael
   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.
    the compiler/platform/target in a consequent way.
 
 
     OS_XXXX         The operating system used (XXXX may be one of:
     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
     PPC_XXXX        The compiler used: BP, FPK, Virtual, Speed
     BIT_XX          The number of bits of the target platform: 16 or 32
     BIT_XX          The number of bits of the target platform: 16 or 32
     PROC_XXXX       The mode of the target processor (Real or Protected)
     PROC_XXXX       The mode of the target processor (Real or Protected)
@@ -36,7 +36,7 @@
    Changelog:
    Changelog:
 
 
      Date       Version        Who        Comments
      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
      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.3            LdeB       Added assembler type change
      29 Aug 97  0.4            LdeB       OS_DOS removed from Windows
      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.
      27 Aug 98  1.0            LdeB       Fixed Atari etc not $UNDEF OS_DOS.
 
 
      25 Oct 98  1.1            pfv        Delphi4
      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.
     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
  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
  WINDOWS  OS_WINDOWS  BP/TP7   PPC_BP       PROC_Protected  BIT_16  ASM_BP
                       DELPHI   PPC_DELPHI   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
                       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
   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         ----
  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
  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
  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}
 {$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           }
 {  Note: Other linux compilers would need to change other details           }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
-{$IFDEF LINUX}
+{$IFDEF UNIX}
   {$UNDEF OS_DOS}
   {$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}
 {$ENDIF}
 
 
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
@@ -302,7 +323,10 @@ FOR FPC THESE ARE THE TRANSLATIONS
 
 
 {
 {
   $Log$
   $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
   + removed logs
  
  
 }
 }