Browse Source

* use definition of pthread_mutex_t from ptypes.h instead of
the linux definition in the system unit

git-svn-id: trunk@185 -

Jonas Maebe 20 years ago
parent
commit
7a79e0f083
6 changed files with 84 additions and 11 deletions
  1. 4 0
      .gitattributes
  2. 8 11
      rtl/bsd/sysosh.inc
  3. 18 0
      rtl/darwin/pmutext.inc
  4. 18 0
      rtl/freebsd/pmutext.inc
  5. 18 0
      rtl/netbsd/pmutext.inc
  6. 18 0
      rtl/openbsd/pmutext.inc

+ 4 - 0
.gitattributes

@@ -3369,6 +3369,7 @@ rtl/darwin/Makefile -text
 rtl/darwin/Makefile.fpc svneol=native#text/plain
 rtl/darwin/console.pp svneol=native#text/plain
 rtl/darwin/errno.inc svneol=native#text/plain
+rtl/darwin/pmutext.inc svneol=native#text/plain
 rtl/darwin/powerpc/sig_cpu.inc svneol=native#text/plain
 rtl/darwin/powerpc/sighnd.inc svneol=native#text/plain
 rtl/darwin/pthread.inc svneol=native#text/plain
@@ -3413,6 +3414,7 @@ rtl/freebsd/i386/prt0.as -text
 rtl/freebsd/i386/sighnd.inc svneol=native#text/plain
 rtl/freebsd/i386/x86.inc svneol=native#text/plain
 rtl/freebsd/i386/x86h.inc svneol=native#text/plain
+rtl/freebsd/pmutext.inc svneol=native#text/plain
 rtl/freebsd/pthread.inc svneol=native#text/plain
 rtl/freebsd/ptypes.inc svneol=native#text/plain
 rtl/freebsd/signal.inc svneol=native#text/plain
@@ -3737,6 +3739,7 @@ rtl/netbsd/i386/cprt0.as -text
 rtl/netbsd/i386/prt0.as -text
 rtl/netbsd/i386/prt0_10.as -text
 rtl/netbsd/i386/sighnd.inc svneol=native#text/plain
+rtl/netbsd/pmutext.inc svneol=native#text/plain
 rtl/netbsd/powerpc/cprt0.as -text
 rtl/netbsd/powerpc/prt0.as -text
 rtl/netbsd/powerpc/sighnd.inc svneol=native#text/plain
@@ -3938,6 +3941,7 @@ rtl/openbsd/errno.inc svneol=native#text/plain
 rtl/openbsd/i386/cprt0.as -text
 rtl/openbsd/i386/prt0.as -text
 rtl/openbsd/i386/sighnd.inc svneol=native#text/plain
+rtl/openbsd/pmutext.inc svneol=native#text/plain
 rtl/openbsd/ptypes.inc svneol=native#text/plain
 rtl/openbsd/signal.inc svneol=native#text/plain
 rtl/openbsd/syscalls.inc svneol=native#text/plain

+ 8 - 11
rtl/bsd/sysosh.inc

@@ -19,20 +19,17 @@
 type
   { fd are int in C also for 64bit targets (x86_64) }
   THandle = Longint;
-  TThreadID = THandle;
+{$ifdef darwin}
+{$ifndef cpu64}
+  TThreadID = Longint;
+{$else cpu64}
+  TThreadID = int64;
+{$endif}
+{$endif darwin}
   
   { pthread_mutex_t }
   PRTLCriticalSection = ^TRTLCriticalSection;
-  TRTLCriticalSection = record
-    __m_reserved: longint;
-    __m_count: longint;
-    __m_owner: pointer;
-    __m_kind:  longint;
-    __m_lock:  record
-       __status: sizeint;
-      __spinlock: longint;
-    end;
-  end;
+  TRTLCriticalSection = {$i pmutext.inc}
 
 
 {

+ 18 - 0
rtl/darwin/pmutext.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Peter Vreman
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ definition of pthread_mutex_t, because needed in both ptypes.inc and }
+{ in sysosh.inc                                                        }
+
+record sig: {$ifdef cpu64}int64{$else}longint{$endif}; opaque: array[0..40-1] of byte; end;

+ 18 - 0
rtl/freebsd/pmutext.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Peter Vreman
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ definition of pthread_mutex_t, because needed in both ptypes.inc and }
+{ in sysosh.inc                                                        }
+
+pointer;

+ 18 - 0
rtl/netbsd/pmutext.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Peter Vreman
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ definition of pthread_mutex_t, because needed in both ptypes.inc and }
+{ in sysosh.inc                                                        }
+
+pointer;

+ 18 - 0
rtl/openbsd/pmutext.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Peter Vreman
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{ definition of pthread_mutex_t, because needed in both ptypes.inc and }
+{ in sysosh.inc                                                        }
+
+pointer;