GLX: Support TLS with better portability

AX_TLS detects when toolchains support __thread or __declspec(thread),
but existing code assumed __thread.

This also adds a check to configure.ac to error out if TLS is requested
but unsupported.

Found-by: Tinderbox
http://tinderbox.x.org/builds/2011-03-22-0007

Regression-from: 82b1eaa6ca

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Tom Fogal <tfogal@alumni.unh.edu>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
This commit is contained in:
Jeremy Huddleston 2011-03-22 19:01:48 -07:00
commit c55baebf4e
5 changed files with 11 additions and 5 deletions

View file

@ -184,11 +184,11 @@ static GLint NoOpUnused(void)
/*@{*/
#if defined(GLX_USE_TLS)
PUBLIC __thread struct _glapi_table * _glapi_tls_Dispatch
PUBLIC TLS struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec")))
= (struct _glapi_table *) __glapi_noop_table;
PUBLIC __thread void * _glapi_tls_Context
PUBLIC TLS void * _glapi_tls_Context
__attribute__((tls_model("initial-exec")));
PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL;