aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2008-09-03 06:07:34 +0000
committerDanny Smith <dannysmith@gcc.gnu.org>2008-09-03 06:07:34 +0000
commitfea16f8128f9bf18b100c4dbdaed907d73258599 (patch)
treead7a052c71cb20b5f9e5cb79f828adcde10cefd1 /gcc
parent4ad610c9785f0022e5ebe686650abaa7ff3c2d5c (diff)
downloadgcc-fea16f8128f9bf18b100c4dbdaed907d73258599.zip
gcc-fea16f8128f9bf18b100c4dbdaed907d73258599.tar.gz
gcc-fea16f8128f9bf18b100c4dbdaed907d73258599.tar.bz2
gthr-win32.h (CONST_CAST2): Really make sure CONST_CAST2 is defined.
* gthr-win32.h (CONST_CAST2): Really make sure CONST_CAST2 is defined. (__gthread_setspecific): Revert 2008-08-31 change to __GTHREAD_HIDE_W32API case. Apply it to !__GTHREAD_HIDE_W32API case. From-SVN: r139927
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gthr-win32.h15
2 files changed, 18 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ee3bf7d..6bf89c0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2008-09-03 Danny Smith <dannysmith@usrs.sourceforge.net>
+
+ * gthr-win32.h (CONST_CAST2): Really make sure CONST_CAST2 is
+ defined.
+ (__gthread_setspecific): Revert 2008-08-31 change to
+ __GTHREAD_HIDE_W32API case. Apply it to !__GTHREAD_HIDE_W32API
+ case.
+
2008-09-02 Aldy Hernandez <aldyh@redhat.com>
* diagnostic.c (error_at): New.
diff --git a/gcc/gthr-win32.h b/gcc/gthr-win32.h
index f236aa3..e9a6e88 100644
--- a/gcc/gthr-win32.h
+++ b/gcc/gthr-win32.h
@@ -32,6 +32,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifndef GCC_GTHR_WIN32_H
#define GCC_GTHR_WIN32_H
+/* Make sure CONST_CAST2 (origin in system.h) is declared. */
+#ifndef CONST_CAST2
+#define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq)
+#endif
+
/* Windows32 threads specific definitions. The windows32 threading model
does not map well into pthread-inspired gcc's threading model, and so
there are caveats one needs to be aware of.
@@ -455,10 +460,7 @@ __gthread_getspecific (__gthread_key_t key)
static inline int
__gthread_setspecific (__gthread_key_t key, const void *ptr)
{
- if (TlsSetValue (key, CONST_CAST2(void *, const void *, ptr)) != 0)
- return 0;
- else
- return GetLastError ();
+ return __gthr_win32_setspecific (key, ptr);
}
static inline void
@@ -615,7 +617,10 @@ __gthread_getspecific (__gthread_key_t key)
static inline int
__gthread_setspecific (__gthread_key_t key, const void *ptr)
{
- return (TlsSetValue (key, (void*) ptr) != 0) ? 0 : (int) GetLastError ();
+ if (TlsSetValue (key, CONST_CAST2(void *, const void *, ptr)) != 0)
+ return 0;
+ else
+ return GetLastError ();
}
static inline void