summaryrefslogtreecommitdiff
path: root/gcc/gthr-posix.h
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-31 12:01:07 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-31 12:01:07 +0000
commitecd34a083ef758a6a59a9df0a24a7aedfee5cd34 (patch)
tree9da070fa50d61c24f4bb30ee44be274f1103d7fc /gcc/gthr-posix.h
parent90e5cba77b5686e7c51d04caf6fab0a8f0523a56 (diff)
downloadgcc-ecd34a083ef758a6a59a9df0a24a7aedfee5cd34.tar.gz
* config.gcc (alpha*-dec-osf[45]*): Enable POSIX thread support by
default. * gthr-posix.c: New file. * gthr-posix.h: Define _REENTRANT if missing. Make _LIBOBJC #pragma weak visible with _LIBOBJC_WEAK. * config/alpha/t-osf4 (SHLIB_LINK): Hide dummy functions provided by gthr-posix.o. * config/alpha/t-osf-pthread: New file. * fixinc/inclhack.def (alpha_pthread): New fix. * fixinc/fixincl.x: Regenerate. * fixinc/tests/base/pthread.h [ALPHA_PTHREAD_CHECK]: New testcase. * doc/install.texi (alpha*-dec-osf*): Remove --enable-threads warning. Fixes PR bootstrap/9330. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69998 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-posix.h')
-rw-r--r--gcc/gthr-posix.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index 02f70aa9b32..88234daae93 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -1,6 +1,7 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -34,6 +35,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define __GTHREADS 1
+/* Some implementations of <pthread.h> require this to be defined. */
+#ifndef _REENTRANT
+#define _REENTRANT 1
+#endif
+
#include <pthread.h>
#include <unistd.h>
@@ -57,7 +63,7 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_mutex_trylock
#pragma weak pthread_mutex_unlock
-#ifdef _LIBOBJC
+#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
/* Objective-C. */
#pragma weak pthread_cond_broadcast
#pragma weak pthread_cond_destroy
@@ -82,7 +88,7 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_getschedparam
#pragma weak pthread_setschedparam
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
-#endif /* _LIBOBJC */
+#endif /* _LIBOBJC || _LIBOBJC_WEAK */
static inline int
__gthread_active_p (void)