diff options
author | marha <marha@users.sourceforge.net> | 2011-04-01 06:31:06 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-01 06:31:06 +0000 |
commit | dab40e0df33e80dab53b4ca20760c1fb4388649b (patch) | |
tree | 5096538daf80f8f4b536cb730fd247c9f40664b7 /xorg-server | |
parent | 70a13fe295183aeea369adcb94f2d67e69fab387 (diff) | |
download | vcxsrv-dab40e0df33e80dab53b4ca20760c1fb4388649b.tar.gz vcxsrv-dab40e0df33e80dab53b4ca20760c1fb4388649b.tar.bz2 vcxsrv-dab40e0df33e80dab53b4ca20760c1fb4388649b.zip |
Synchronised files
Diffstat (limited to 'xorg-server')
-rw-r--r-- | xorg-server/glx/glapi.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/xorg-server/glx/glapi.h b/xorg-server/glx/glapi.h index 541ea8d87..98f3913a9 100644 --- a/xorg-server/glx/glapi.h +++ b/xorg-server/glx/glapi.h @@ -94,6 +94,8 @@ typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...); **/
#if defined (GLX_USE_TLS)
+_GLAPI_EXPORT extern __thread struct _glapi_table * _glapi_tls_Dispatch
+ __attribute__((tls_model("initial-exec")));
_GLAPI_EXPORT extern const void *_glapi_Context;
_GLAPI_EXPORT extern const struct _glapi_table *_glapi_Dispatch;
@@ -101,7 +103,8 @@ _GLAPI_EXPORT extern const struct _glapi_table *_glapi_Dispatch; _GLAPI_EXPORT extern __thread void * _glapi_tls_Context
__attribute__((tls_model("initial-exec")));
-# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
+# define GET_DISPATCH() _glapi_tls_Dispatch
+# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_tls_Context
#else
@@ -115,9 +118,16 @@ SERVEXTERN void *_glapi_Context; SERVEXTERN struct _glapi_table *_glapi_Dispatch;
# ifdef THREADS
-# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context())
+
+# define GET_DISPATCH() \
+ (likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch())
+
+
+# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \
+ (likely(_glapi_Context) ? _glapi_Context : _glapi_get_context())
# else
-# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context
+# define GET_DISPATCH() _glapi_Dispatch
+# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_Context
# endif
#endif /* defined (GLX_USE_TLS) */
|