diff options
author | Aaron W. LaFramboise <aaronavay62@aaronwl.com> | 2008-08-31 12:26:48 -0600 |
---|---|---|
committer | Aaron W. LaFramboise <aaronwl@gcc.gnu.org> | 2008-08-31 12:26:48 -0600 |
commit | 9e2af376dd368ddb79ade1244833e609ea1fecdf (patch) | |
tree | 6f43c2974ef4864e591ee40d64775d3130ae794a /gcc | |
parent | 6528b88d94b120185f9c8971749fb2d32870d66b (diff) | |
download | gcc-9e2af376dd368ddb79ade1244833e609ea1fecdf.zip gcc-9e2af376dd368ddb79ade1244833e609ea1fecdf.tar.gz gcc-9e2af376dd368ddb79ade1244833e609ea1fecdf.tar.bz2 |
gthr-win32.h (__gthread_setspecific): Use CONST_CAST2.
2008-08-31 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
* gcc/gthr-win32.h (__gthread_setspecific): Use CONST_CAST2.
From-SVN: r139839
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/i386/gthr-win32.c | 5 | ||||
-rw-r--r-- | gcc/gthr-win32.h | 5 |
3 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7b14a2c..4f7a34d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2008-08-31 Aaron W. LaFramboise <aaronavay62@aaronwl.com> + * gthr-win32.h (__gthread_setspecific): Use CONST_CAST2. + * config/i386/gthr-win32.c (__gthread_setspecific): Same. + +2008-08-31 Aaron W. LaFramboise <aaronavay62@aaronwl.com> + * mkmap-flat.awk: Add option pe_dll. * config/i386/t-cygming (SHLIB_LINK): Support building libgcc_s. * config/i386/t-cygwin (SHLIB_LC): Add. diff --git a/gcc/config/i386/gthr-win32.c b/gcc/config/i386/gthr-win32.c index 3810fc0..666a936 100644 --- a/gcc/config/i386/gthr-win32.c +++ b/gcc/config/i386/gthr-win32.c @@ -141,7 +141,10 @@ __gthr_win32_getspecific (__gthread_key_t key) int __gthr_win32_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 (); } void diff --git a/gcc/gthr-win32.h b/gcc/gthr-win32.h index adf6efb..f236aa3 100644 --- a/gcc/gthr-win32.h +++ b/gcc/gthr-win32.h @@ -455,7 +455,10 @@ __gthread_getspecific (__gthread_key_t key) static inline int __gthread_setspecific (__gthread_key_t key, const void *ptr) { - return __gthr_win32_setspecific (key, ptr); + if (TlsSetValue (key, CONST_CAST2(void *, const void *, ptr)) != 0) + return 0; + else + return GetLastError (); } static inline void |