From 1d2dbb9eb220f313ebc712f1c69c611f6867da54 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sun, 8 May 2011 00:23:14 +0200 Subject: linuxthreads: guard *tsd* related stuff correctly Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h | 7 +++---- libpthread/linuxthreads/internals.h | 2 ++ libpthread/linuxthreads/pthread.c | 2 +- libpthread/linuxthreads/specific.c | 2 +- libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h | 2 ++ 5 files changed, 9 insertions(+), 6 deletions(-) (limited to 'libpthread') diff --git a/libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h b/libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h index 31d859ec3..bee7eb1be 100644 --- a/libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h +++ b/libpthread/linuxthreads.old/sysdeps/pthread/bits/libc-tsd.h @@ -30,12 +30,11 @@ enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0, _LIBC_TSD_KEY_CTYPE_TOUPPER, _LIBC_TSD_KEY_N }; -#include -#include - +#include #include -#if defined(USE_TLS) && USE_TLS && HAVE___THREAD +#ifdef __UCLIBC_HAS_TLS__ +#include /* When __thread works, the generic definition is what we want. */ # include diff --git a/libpthread/linuxthreads/internals.h b/libpthread/linuxthreads/internals.h index e855f5062..4ce39fb4b 100644 --- a/libpthread/linuxthreads/internals.h +++ b/libpthread/linuxthreads/internals.h @@ -438,10 +438,12 @@ extern void __linuxthreads_reap_event (void); extern void __pthread_initialize (void); /* TSD. */ +#if !defined __UCLIBC_HAS_TLS__ && defined __UCLIBC_HAS_RPC__ extern int __pthread_internal_tsd_set (int key, const void * pointer); extern void * __pthread_internal_tsd_get (int key); extern void ** __attribute__ ((__const__)) __pthread_internal_tsd_address (int key); +#endif /* Sighandler wrappers. */ extern void __pthread_sighandler(int signo, SIGCONTEXT ctx); diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c index 043146bfa..5dccd939f 100644 --- a/libpthread/linuxthreads/pthread.c +++ b/libpthread/linuxthreads/pthread.c @@ -230,7 +230,7 @@ extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign); struct pthread_functions __pthread_functions = { -#ifndef __UCLIBC_HAS_TLS__ +#if !defined __UCLIBC_HAS_TLS__ && defined __UCLIBC_HAS_RPC__ .ptr_pthread_internal_tsd_set = __pthread_internal_tsd_set, .ptr_pthread_internal_tsd_get = __pthread_internal_tsd_get, .ptr_pthread_internal_tsd_address = __pthread_internal_tsd_address, diff --git a/libpthread/linuxthreads/specific.c b/libpthread/linuxthreads/specific.c index 4a6dad308..0daad83f5 100644 --- a/libpthread/linuxthreads/specific.c +++ b/libpthread/linuxthreads/specific.c @@ -212,7 +212,7 @@ void __pthread_destroy_specifics() __pthread_unlock(THREAD_GETMEM(self, p_lock)); } -#ifndef __UCLIBC_HAS_TLS__ +#if !defined __UCLIBC_HAS_TLS__ && defined __UCLIBC_HAS_RPC__ /* Thread-specific data for libc. */ diff --git a/libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h b/libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h index 44677e886..04d45467c 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h +++ b/libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h @@ -72,10 +72,12 @@ struct pthread_functions void (*ptr_pthread_cleanup_upto) (__jmp_buf target, char *targetframe); pthread_descr (*ptr_pthread_thread_self) (void); +#if !defined __UCLIBC_HAS_TLS__ && defined __UCLIBC_HAS_RPC__ int (*ptr_pthread_internal_tsd_set) (int key, const void *pointer); void * (*ptr_pthread_internal_tsd_get) (int key); void ** __attribute__ ((__const__)) (*ptr_pthread_internal_tsd_address) (int key); +#endif int (*ptr_pthread_sigaction) (int sig, const struct sigaction * act, struct sigaction *oact); int (*ptr_pthread_sigwait) (const sigset_t *set, int *sig); -- cgit v1.2.3