From 5467baef041885837b8abd2a7f64aef4cf35e954 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Wed, 16 May 2001 16:08:41 +0000 Subject: [PATCH] pa-hpux10.h (THREAD_MODEL_SPEC): Define. * 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. From-SVN: r42157 --- gcc/ChangeLog | 9 +++++++++ gcc/config/pa/pa-hpux10.h | 5 ++++- gcc/gthr-dce.h | 21 +++++++++++++++++++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e9f44fd544e..f49f7529645 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2001-05-16 John David Anglin + + * 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. + 2001-05-16 David Edelsohn * doc/install.texi: Update AIX information. diff --git a/gcc/config/pa/pa-hpux10.h b/gcc/config/pa/pa-hpux10.h index c9322b9ab65..ce9969d59f7 100644 --- a/gcc/config/pa/pa-hpux10.h +++ b/gcc/config/pa/pa-hpux10.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1 - Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. Contributed by Tim Moore (moore@defmacro.cs.utah.edu) This file is part of GNU CC. @@ -40,6 +40,9 @@ Boston, MA 02111-1307, USA. */ %{p: -L/lib/libp/ -lc}\ %{pg: -L/lib/libp/ -lc}}" +#undef THREAD_MODEL_SPEC +#define THREAD_MODEL_SPEC "%{!threads:single}%{threads:dce}" + /* Under hpux10, the normal location of the `ld' and `as' programs is the /usr/ccs/bin directory. */ 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 +#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 */ -- 2.30.2