diff options
author | Brian Paul <[email protected]> | 2015-03-04 19:17:57 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2015-03-05 06:59:43 -0700 |
commit | 18db13f586509f4fc196839886efcfd0715d8db0 (patch) | |
tree | 7804953f7a1481c9c4f07bcc58d457f995d13995 /src/mapi/u_current.c | |
parent | fac77912b5faa2394e0c0a88f3862eae9d87967a (diff) |
mapi: THREADS was always defined, remove it
THREADS was defined if HAVE_PTHREADS or _WIN32 was defined. That's
always the case. The build would die in c11/threads.h otherwise.
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/mapi/u_current.c')
-rw-r--r-- | src/mapi/u_current.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/mapi/u_current.c b/src/mapi/u_current.c index c1a486bd0e1..036572483c2 100644 --- a/src/mapi/u_current.c +++ b/src/mapi/u_current.c @@ -112,11 +112,9 @@ struct mapi_table *u_current_table = (struct mapi_table *) table_noop_array; void *u_current_context; -#ifdef THREADS struct u_tsd u_current_table_tsd; static struct u_tsd u_current_context_tsd; static int ThreadSafe; -#endif /* THREADS */ #endif /* defined(GLX_USE_TLS) */ /*@}*/ @@ -125,14 +123,14 @@ static int ThreadSafe; void u_current_destroy(void) { -#if defined(THREADS) && !defined(GLX_USE_TLS) +#if !defined(GLX_USE_TLS) u_tsd_destroy(&u_current_table_tsd); u_tsd_destroy(&u_current_context_tsd); #endif } -#if defined(THREADS) && !defined(GLX_USE_TLS) +#if !defined(GLX_USE_TLS) static void u_current_init_tsd(void) @@ -234,11 +232,9 @@ u_current_set_context(const void *ptr) #if defined(GLX_USE_TLS) u_current_context = (void *) ptr; -#elif defined(THREADS) +#else u_tsd_set(&u_current_context_tsd, (void *) ptr); u_current_context = (ThreadSafe) ? NULL : (void *) ptr; -#else - u_current_context = (void *) ptr; #endif } @@ -252,12 +248,10 @@ u_current_get_context_internal(void) { #if defined(GLX_USE_TLS) return u_current_context; -#elif defined(THREADS) +#else return (ThreadSafe) ? u_tsd_get(&u_current_context_tsd) : u_current_context; -#else - return u_current_context; #endif } @@ -278,11 +272,9 @@ u_current_set_table(const struct mapi_table *tbl) #if defined(GLX_USE_TLS) u_current_table = (struct mapi_table *) tbl; -#elif defined(THREADS) +#else u_tsd_set(&u_current_table_tsd, (void *) tbl); u_current_table = (ThreadSafe) ? NULL : (void *) tbl; -#else - u_current_table = (struct mapi_table *) tbl; #endif } @@ -294,10 +286,8 @@ u_current_get_table_internal(void) { #if defined(GLX_USE_TLS) return u_current_table; -#elif defined(THREADS) +#else return (struct mapi_table *) ((ThreadSafe) ? u_tsd_get(&u_current_table_tsd) : (void *) u_current_table); -#else - return u_current_table; #endif } |