Browse Source

+ FCL made compilable under OS/2

Tomas Hajny 25 years ago
parent
commit
c6b147229b
3 changed files with 43 additions and 17 deletions
  1. 5 2
      fcl/os2/classes.pp
  2. 6 6
      fcl/os2/pipes.inc
  3. 32 9
      fcl/os2/thread.inc

+ 5 - 2
fcl/os2/classes.pp

@@ -24,6 +24,7 @@ unit Classes;
 interface
 
 uses
+  DosCalls, (* Needed here (i.e. before SysUtils) to avoid type clashes. *)
   strings,
   sysutils;
 
@@ -32,7 +33,6 @@ uses
 implementation
 
 uses
-  doscalls,
   typinfo;
 
 { OS - independent class implementations are in /inc directory. }
@@ -47,7 +47,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.1.2.1  2000-08-25 17:30:36  hajny
+  Revision 1.1.2.2  2000-12-19 00:44:06  hajny
+    + FCL made compilable under OS/2
+
+  Revision 1.1.2.1  2000/08/25 17:30:36  hajny
     * Cosmetic change (OS/2 instead of win32 in header)
 
   Revision 1.1  2000/07/13 06:33:44  michael

+ 6 - 6
fcl/os2/pipes.inc

@@ -14,13 +14,13 @@
 
  **********************************************************************}
 
-Function CreatePipeHandles (Var Inhandle,OutHandle : Longint) : Boolean;
+uses
+ DosCalls;
 
+const
+ PipeBufSize = 1024;
+
+function CreatePipeHandles (var InHandle, OutHandle: longint): boolean;
 begin
   CreatePipeHandles := DosCreatePipe (InHandle, OutHandle, PipeBufSize) = 0;
 end;
-  $Log$
-  Revision 1.2  2000-07-13 11:33:01  michael
-  + removed logs
- 
-}

+ 32 - 9
fcl/os2/thread.inc

@@ -16,17 +16,18 @@
 {****************************************************************************}
 
 const
- Priorities: array [TThreadPriority] of word = ($100, $200, $207, $20F, $217
-  $21F, $300);
+ Priorities: array [TThreadPriority] of word = ($100, $200, $207, $20F, $217,
+                                                                   $21F, $300);
+ ThreadCount: longint = 0;
 
 
-procedure AddThread;
+procedure AddThread (T: TThread);
 begin
  Inc (ThreadCount);
 end;
 
 
-procedure RemoveThread;
+procedure RemoveThread (T: TThread);
 begin
  Dec (ThreadCount);
 end;
@@ -89,9 +90,10 @@ begin
 end;
 
 
-function ThreadProc(Thread: TThread): Integer; cdecl;
+function ThreadProc(Args: pointer): Integer; cdecl;
 var
   FreeThread: Boolean;
+  Thread: TThread absolute Args;
 begin
   Thread.Execute;
   FreeThread := Thread.FFreeOnTerminate;
@@ -109,7 +111,7 @@ begin
   inherited Create;
   AddThread (Self);
   FSuspended := CreateSuspended;
-  Flags := dtStack_Committed;
+  Flags := dtStack_Commited;
   if FSuspended then Flags := Flags or dtSuspended;
   if DosCreateThread (FThreadID, @ThreadProc, pointer (Self), Flags, 16384)
                                                                       <> 0 then
@@ -159,7 +161,28 @@ end;
 
 {
   $Log$
-  Revision 1.2  2000-07-13 11:33:02  michael
-  + removed logs
- 
+  Revision 1.1.2.1  2000-12-19 00:44:06  hajny
+    + FCL made compilable under OS/2
+
+  Revision 1.1  2000/07/13 06:33:44  michael
+  + Initial import
+
+  Revision 1.5  2000/04/01 10:45:52  hajny
+    OS/2 implementation started
+
+  Revision 1.4  2000/01/07 01:24:34  peter
+    * updated copyright to 2000
+
+  Revision 1.3  2000/01/06 01:20:34  peter
+    * moved out of packages/ back to topdir
+
+  Revision 1.1  2000/01/03 19:33:09  peter
+    * moved to packages dir
+
+  Revision 1.1  1999/05/30 10:46:43  peter
+    * start of tthread for linux,win32
+
+  Revision 1.2  1999/04/08 10:18:57  peter
+    * makefile updates
+
 }