Bläddra i källkod

* criticalsection renamed to rtlcriticalsection for kylix compatibility

peter 24 år sedan
förälder
incheckning
5d62342562

+ 13 - 5
fcl/inc/classesh.inc

@@ -17,12 +17,14 @@
 
 type
    { extra types to compile with FPC }
-
-   TRTLCriticalSection = class(TObject);
    HRSRC = longint;
    THANDLE = longint;
    TComponentName = string;
 {$ifdef ver1_0}
+   // 1.0 doesn't have thread
+   TRTLCriticalSection = record
+     locked : longint;
+   end;
    // 1.1 and above has interfaces
    IUnknown = class(TObject);
    TGUID = longint;
@@ -57,13 +59,16 @@ const
   scNone = 0;
 
 { TStream seek origins }
-
+const
   soFromBeginning = 0;
   soFromCurrent = 1;
   soFromEnd = 2;
 
-{ TFileStream create mode }
+type
+  TSeekOrigin = (soBeginning, soCurrent, soEnd);
 
+{ TFileStream create mode }
+const
   fmCreate        = $FFFF;
   fmOpenRead      = 0;
   fmOpenWrite     = 1;
@@ -1284,7 +1289,10 @@ function LineStart(Buffer, BufPos: PChar): PChar;
 
 {
   $Log$
-  Revision 1.11  2001-08-12 22:10:36  peter
+  Revision 1.12  2001-10-23 21:51:02  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.11  2001/08/12 22:10:36  peter
     * some interface updates for 1.1
 
   Revision 1.10  2001/05/14 21:17:24  florian

+ 5 - 2
rtl/inc/heap.inc

@@ -39,7 +39,7 @@
 
 {$ifdef MT}
 var
-   cs_systemheap : TCriticalSection;
+   cs_systemheap : TRTLCriticalSection;
 {$endif MT}
 
 const
@@ -1125,7 +1125,10 @@ end;
 
 {
   $Log$
-  Revision 1.6  2001-06-06 17:20:22  jonas
+  Revision 1.7  2001-10-23 21:51:03  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.6  2001/06/06 17:20:22  jonas
     * fixed wrong typed constant procvars in preparation of my fix which will
       disallow them in FPC mode (plus some other unmerged changes since
       LAST_MERGE)

+ 8 - 5
rtl/inc/threadh.inc

@@ -38,16 +38,19 @@ procedure EndThread;
 { this allows to do a lot of things in MT safe way }
 { it is also used to make the heap management      }
 { thread safe                                      }
-procedure InitCriticalsection(var cs : tcriticalsection);
-procedure DoneCriticalsection(var cs : tcriticalsection);
-procedure EnterCriticalsection(var cs : tcriticalsection);
-procedure LeaveCriticalsection(var cs : tcriticalsection);
+procedure InitCriticalSection(var cs : TRTLCriticalSection);
+procedure DoneCriticalsection(var cs : TRTLCriticalSection);
+procedure EnterCriticalsection(var cs : TRTLCriticalSection);
+procedure LeaveCriticalsection(var cs : TRTLCriticalSection);
 
 {$endif MT}
 
 {
   $Log$
-  Revision 1.4  2001-01-26 16:37:54  florian
+  Revision 1.5  2001-10-23 21:51:03  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.4  2001/01/26 16:37:54  florian
   *** empty log message ***
 
   Revision 1.3  2001/01/24 21:47:18  florian

+ 20 - 2
rtl/objpas/sysutilh.inc

@@ -35,13 +35,28 @@ type
    tintegerset = set of 0..sizeof(integer)*8-1;
 
    longrec = packed record
-      lo,hi : word;
+      case integer of
+        0 : (lo,hi : word);
+        1 : (bytes : array[0..3] of byte);
    end;
 
    wordrec = packed record
       lo,hi : byte;
    end;
 
+   int64rec = packed record
+      case integer of
+        0 : (lo,hi : cardinal);
+        1 : (words : array[0..3] of word);
+        2 : (bytes : array[0..7] of byte);
+   end;
+
+   pbytearray = ^tbytearray;
+   tbytearray = array[0..32767] of byte;
+
+   pwordarray = ^twordarray;
+   twordarray = array[0..16383] of word;
+
    TMethod = packed record
      Code, Data: Pointer;
    end;
@@ -156,7 +171,10 @@ Type
 
 {
   $Log$
-  Revision 1.13  2001-08-22 21:19:16  florian
+  Revision 1.14  2001-10-23 21:51:03  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.13  2001/08/22 21:19:16  florian
     + some new stuff of D6/Kylix added
 
   Revision 1.12  2001/08/22 14:11:28  florian

+ 5 - 2
rtl/os2/system.pas

@@ -61,7 +61,7 @@ type
     (* TH: To make things easier, I copied the record definition *)
     (* from the Win32 version and just added longint variants,   *)
     (* because it seemed well suited for OS/2 too.               *)
-    TCriticalSection = packed record
+    TRTLCriticalSection = packed record
         DebugInfo: pointer;
         LockCount: longint;
         RecursionCount: longint;
@@ -1066,7 +1066,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.15  2001-06-19 20:46:07  hajny
+  Revision 1.16  2001-10-23 21:51:03  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.15  2001/06/19 20:46:07  hajny
     * platform specific constants moved after systemh.inc, BeOS omission corrected
 
   Revision 1.14  2001/06/13 22:21:53  hajny

+ 9 - 6
rtl/os2/thread.inc

@@ -50,7 +50,7 @@ function DosFreeThreadLocalMemory (P: pointer): longint; cdecl;
                                                  external 'DOSCALLS' index 455;
 
 function DosCreateThread (var TID: longint; Address: pointer;
-(* TThreadFunc *) 
+(* TThreadFunc *)
         aParam: pointer; Flags: longint; StackSize: longint): longint; cdecl;
                                                  external 'DOSCALLS' index 311;
 
@@ -240,7 +240,7 @@ begin
  EndThread (0);
 end;
 
-procedure InitCriticalSection (var CS: TCriticalSection);
+procedure InitCriticalSection (var CS: TRTLCriticalSection);
 begin
  if os_mode = osOS2 then
  begin
@@ -254,12 +254,12 @@ begin
  end;
 end;
 
-procedure DoneCriticalSection (var CS: TCriticalSection);
+procedure DoneCriticalSection (var CS: TRTLCriticalSection);
 begin
  if os_mode = osOS2 then DosCloseMutExSem (CS.LockSemaphore2);
 end;
 
-procedure EnterCriticalSection (var CS: TCriticalSection);
+procedure EnterCriticalSection (var CS: TRTLCriticalSection);
 var
  P, T, Cnt: longint;
  PTIB: PThreadInfoBlock;
@@ -293,7 +293,7 @@ begin
  end;
 end;
 
-procedure LeaveCriticalSection (var CS: TCriticalSection);
+procedure LeaveCriticalSection (var CS: TRTLCriticalSection);
 var
  PTIB: PThreadInfoBlock;
  Err: boolean;
@@ -325,7 +325,10 @@ end;
 
 {
   $Log$
-  Revision 1.5  2001-10-09 02:42:05  carl
+  Revision 1.6  2001-10-23 21:51:03  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.5  2001/10/09 02:42:05  carl
   * bugfix #1639 (IsMultiThread varialbe setting)
 
   Revision 1.4  2001/02/04 01:53:58  hajny

+ 5 - 2
rtl/unix/sysunixh.inc

@@ -24,7 +24,7 @@ type
    { the fields of this record are os dependent  }
    { and they shouldn't be used in a program     }
    { only the type TCriticalSection is important }
-   TCriticalSection = packed record
+   TRTLCriticalSection = packed record
       DebugInfo : pointer;
       LockCount : longint;
       RecursionCount : longint;
@@ -73,7 +73,10 @@ var
 
 {
   $Log$
-  Revision 1.11  2001-10-14 13:33:21  peter
+  Revision 1.12  2001-10-23 21:51:03  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.11  2001/10/14 13:33:21  peter
     * start of thread support for linux
 
   Revision 1.10  2001/06/27 21:37:39  peter

+ 8 - 5
rtl/unix/thread.inc

@@ -162,20 +162,20 @@
         EndThread(0);
       end;
 
-    procedure InitCriticalSection(var cs : tcriticalsection);
+    procedure InitCriticalSection(var cs : TRTLCriticalSection);
       begin
       end;
 
-    procedure DoneCriticalSection(var cs : tcriticalsection);
+    procedure DoneCriticalSection(var cs : TRTLCriticalSection);
       begin
       end;
 
 
-    procedure EnterCriticalSection(var cs : tcriticalsection);
+    procedure EnterCriticalSection(var cs : TRTLCriticalSection);
       begin
       end;
 
-    procedure LeaveCriticalSection(var cs : tcriticalsection);
+    procedure LeaveCriticalSection(var cs : TRTLCriticalSection);
       begin
       end;
 
@@ -183,7 +183,10 @@
 
 {
   $Log$
-  Revision 1.1  2001-10-17 10:27:47  marco
+  Revision 1.2  2001-10-23 21:51:03  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.1  2001/10/17 10:27:47  marco
    * Moved to unix/ since there is nothing linux specific about it.
 
   Revision 1.1  2001/10/14 13:33:20  peter

+ 5 - 2
rtl/win32/system.pp

@@ -41,7 +41,7 @@ type
    { the fields of this record are os dependent  }
    { and they shouldn't be used in a program     }
    { only the type TCriticalSection is important }
-   TCriticalSection = packed record
+   TRTLCriticalSection = packed record
       DebugInfo : pointer;
       LockCount : longint;
       RecursionCount : longint;
@@ -1567,7 +1567,10 @@ end.
 
 {
   $Log$
-  Revision 1.18  2001-10-09 02:37:29  carl
+  Revision 1.19  2001-10-23 21:51:03  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.18  2001/10/09 02:37:29  carl
   * bugfix #1639 (IsMultiThread varialbe setting)
 
   Revision 1.17  2001/08/19 21:02:02  florian

+ 8 - 5
rtl/win32/thread.inc

@@ -197,23 +197,26 @@ procedure EndThread;
 
 { we implement these procedures for win32 by importing them }
 { directly from windows                                     }
-procedure InitCriticalSection(var cs : tcriticalsection);
+procedure InitCriticalSection(var cs : TRTLCriticalSection);
   external 'kernel32' name 'InitializeCriticalSection';
 
-procedure DoneCriticalSection(var cs : tcriticalsection);
+procedure DoneCriticalSection(var cs : TRTLCriticalSection);
   external 'kernel32' name 'DeleteCriticalSection';
 
-procedure EnterCriticalSection(var cs : tcriticalsection);
+procedure EnterCriticalSection(var cs : TRTLCriticalSection);
   external 'kernel32' name 'EnterCriticalSection';
 
-procedure LeaveCriticalSection(var cs : tcriticalsection);
+procedure LeaveCriticalSection(var cs : TRTLCriticalSection);
   external 'kernel32' name 'LeaveCriticalSection';
 
 {$endif MT}
 
 {
   $Log$
-  Revision 1.5  2001-10-09 02:38:39  carl
+  Revision 1.6  2001-10-23 21:51:03  peter
+    * criticalsection renamed to rtlcriticalsection for kylix compatibility
+
+  Revision 1.5  2001/10/09 02:38:39  carl
   * bugfix #1639 (IsMultiThread varialbe setting)
 
   Revision 1.4  2001/01/26 21:02:21  florian