summaryrefslogtreecommitdiff
path: root/include/gc_pthread_redirects.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gc_pthread_redirects.h')
-rw-r--r--include/gc_pthread_redirects.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/gc_pthread_redirects.h b/include/gc_pthread_redirects.h
index 99a3e8d..842518c 100644
--- a/include/gc_pthread_redirects.h
+++ b/include/gc_pthread_redirects.h
@@ -58,13 +58,22 @@
int GC_pthread_join(pthread_t thread, void **retval);
int GC_pthread_detach(pthread_t thread);
-# define pthread_create GC_pthread_create
-#ifndef GC_DARWIN_THREADS
-# define pthread_sigmask GC_pthread_sigmask
+#if defined(GC_OSF1_THREADS) \
+ && defined(_PTHREAD_USE_MANGLED_NAMES_) && !defined(_PTHREAD_USE_PTDNAM_)
+/* Unless the compiler supports #pragma extern_prefix, the Tru64 UNIX
+ <pthread.h> redefines some POSIX thread functions to use mangled names.
+ If so, undef them before redefining. */
+# undef pthread_create
+# undef pthread_join
+# undef pthread_detach
#endif
+
+# define pthread_create GC_pthread_create
# define pthread_join GC_pthread_join
# define pthread_detach GC_pthread_detach
+
#ifndef GC_DARWIN_THREADS
+# define pthread_sigmask GC_pthread_sigmask
# define dlopen GC_dlopen
#endif