summaryrefslogtreecommitdiff
path: root/gcc/gthr-dce.h
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-02 01:38:27 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-02 01:38:27 +0000
commitc4cd433db3195dd509ea8231f0231f9ffcaf81e4 (patch)
treea6be5f3cc40559a9fb27163230b0c81cdd8ca1ff /gcc/gthr-dce.h
parentc0045c9e36f70a24e1eb361c284e094a989fbbdb (diff)
downloadgcc-c4cd433db3195dd509ea8231f0231f9ffcaf81e4.tar.gz
* gthr-dce.h (CONST_CAST2): Define if not defined.
(__gthread_setspecific): Use CONST_CAST2 to fix warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150342 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-dce.h')
-rw-r--r--gcc/gthr-dce.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/gthr-dce.h b/gcc/gthr-dce.h
index be92813dc23..4226359f0a0 100644
--- a/gcc/gthr-dce.h
+++ b/gcc/gthr-dce.h
@@ -37,6 +37,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
DCE threads are based on POSIX threads draft 4, and many things
have changed since then. */
+/* Make sure CONST_CAST2 (original in system.h) is defined. */
+#ifndef CONST_CAST2
+#ifdef __cplusplus
+#define CONST_CAST2(TOTYPE,FROMTYPE,X) (const_cast<TOTYPE> (X))
+#else
+#define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq)
+#endif
+#endif
+
#define __GTHREADS 1
#include <pthread.h>
@@ -462,7 +471,8 @@ __gthread_getspecific (__gthread_key_t __key)
static inline int
__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
{
- return __gthrw_(pthread_setspecific) (__key, (void *) __ptr);
+ return __gthrw_(pthread_setspecific)
+ (__key, CONST_CAST2(void *, const void *, __ptr));
}
static inline void