diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-16 16:08:41 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-16 16:08:41 +0000 |
commit | 501b786ec832ca73fa81e748296ea12884460a82 (patch) | |
tree | 0617cca688e5842a687914f9a5dbdc236d06e650 /gcc/gthr-dce.h | |
parent | dcc6d533c9af5c8c090d6358eb6a20b3beccd92d (diff) | |
download | gcc-501b786ec832ca73fa81e748296ea12884460a82.tar.gz |
* pa-hpux10.h (THREAD_MODEL_SPEC): Define.
* gthr-dce.h (UNUSED): Attribute unused macro.
(__gthread_key_dtor): Make arguments UNUSED.
(__gthread_key_delete): Revise for compatibility with DRAFT4
implementation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42157 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-dce.h')
-rw-r--r-- | gcc/gthr-dce.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/gthr-dce.h b/gcc/gthr-dce.h index 761b9482c63..df1b978a798 100644 --- a/gcc/gthr-dce.h +++ b/gcc/gthr-dce.h @@ -1,6 +1,6 @@ /* Compile this one with gcc. */ -/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -37,6 +37,12 @@ Boston, MA 02111-1307, USA. */ #include <pthread.h> +#ifdef __cplusplus +#define UNUSED(x) x +#else +#define UNUSED(x) x __attribute__((unused)) +#endif + typedef pthread_key_t __gthread_key_t; typedef pthread_once_t __gthread_once_t; typedef pthread_mutex_t __gthread_mutex_t; @@ -412,17 +418,26 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) } static inline int -__gthread_key_dtor (__gthread_key_t key, void *ptr) +__gthread_key_dtor (UNUSED (__gthread_key_t key), UNUSED (void *ptr)) { /* Nothing needed. */ return 0; } +#if defined (__PTHREAD_LIBRARY_VERSION_1) && __PTHREAD_LIBRARY_VERSION_1 >= 1 static inline int __gthread_key_delete (__gthread_key_t key) { return pthread_key_delete (key); } +#else +static inline int +__gthread_key_delete (UNUSED (__gthread_key_t key)) +{ + /* Operation is not supported. */ + return -1; +} +#endif static inline void * __gthread_getspecific (__gthread_key_t key) @@ -469,4 +484,6 @@ __gthread_mutex_unlock (__gthread_mutex_t *mutex) #endif /* _LIBOBJC */ +#undef UNUSED + #endif /* not __gthr_dce_h */ |