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/glapi | |
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/glapi')
-rw-r--r-- | src/mapi/glapi/gen/gl_x86-64_asm.py | 6 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_x86_asm.py | 14 | ||||
-rw-r--r-- | src/mapi/glapi/glapi.h | 13 | ||||
-rw-r--r-- | src/mapi/glapi/glapi_entrypoint.c | 4 | ||||
-rw-r--r-- | src/mapi/glapi/glapi_priv.h | 4 |
5 files changed, 7 insertions, 34 deletions
diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py b/src/mapi/glapi/gen/gl_x86-64_asm.py index 19e0e15b061..5a69e0343b2 100644 --- a/src/mapi/glapi/gen/gl_x86-64_asm.py +++ b/src/mapi/glapi/gen/gl_x86-64_asm.py @@ -138,10 +138,6 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))' print '# endif' print '' - print '#if defined(HAVE_PTHREAD) || defined(_WIN32)' - print '# define THREADS' - print '#endif' - print '' print '\t.text' print '' print '#ifdef GLX_USE_TLS' @@ -170,7 +166,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tmovl\t(%rax), %edi' print '\tjmp\tpthread_getspecific@PLT' print '' - print '#elif defined(THREADS)' + print '#else' print '' print '\t.extern\t_glapi_get_dispatch' print '' diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py index d87d0bd24c6..f855dbaaa41 100644 --- a/src/mapi/glapi/gen/gl_x86_asm.py +++ b/src/mapi/glapi/gen/gl_x86_asm.py @@ -78,9 +78,6 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '#define GLOBL_FN(x) GLOBL x' print '#endif' print '' - print '#if defined(HAVE_PTHREAD) || defined(_WIN32)' - print '# define THREADS' - print '#endif' print '' print '#ifdef GLX_USE_TLS' print '' @@ -109,7 +106,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' print '1:\tCALL(_x86_get_dispatch) ;\t\t\t\\' print '\tJMP(GL_OFFSET(off))' - print '#elif defined(THREADS)' + print '#else' print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' print 'ALIGNTEXT16;\t\t\t\t\t\t\\' print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' @@ -120,13 +117,6 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' print '1:\tCALL(_glapi_get_dispatch) ;\t\t\t\\' print '\tJMP(GL_OFFSET(off))' - print '#else /* Non-threaded version. */' - print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' - print 'ALIGNTEXT16;\t\t\t\t\t\t\\' - print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' - print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' - print '\tJMP(GL_OFFSET(off))' print '#endif' print '' print '#ifdef HAVE_ALIAS' @@ -164,7 +154,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tCALL(GLNAME(pthread_getspecific))' print '\tADD_L(CONST(28), ESP)' print '\tRET' - print '#elif defined(THREADS)' + print '#else' print 'EXTERN GLNAME(_glapi_get_dispatch)' print '#endif' print '' diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h index e3f76b47c1c..b2d6632493c 100644 --- a/src/mapi/glapi/glapi.h +++ b/src/mapi/glapi/glapi.h @@ -103,21 +103,12 @@ _GLAPI_EXPORT extern const void *_glapi_Context; _GLAPI_EXPORT extern struct _glapi_table *_glapi_Dispatch; _GLAPI_EXPORT extern void *_glapi_Context; -# ifdef THREADS - -# define GET_DISPATCH() \ +#define GET_DISPATCH() \ (likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch()) -# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \ +#define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \ (likely(_glapi_Context) ? _glapi_Context : _glapi_get_context()) -# else - -# 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) */ diff --git a/src/mapi/glapi/glapi_entrypoint.c b/src/mapi/glapi/glapi_entrypoint.c index 362a8f11b40..53104ce5e58 100644 --- a/src/mapi/glapi/glapi_entrypoint.c +++ b/src/mapi/glapi/glapi_entrypoint.c @@ -120,11 +120,9 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, unsigned int offset) #if defined(GLX_USE_TLS) *((unsigned int *)(code + 8)) = 4 * offset; -#elif defined(THREADS) +#else *((unsigned int *)(code + 11)) = 4 * offset; *((unsigned int *)(code + 22)) = 4 * offset; -#else - *((unsigned int *)(code + 7)) = 4 * offset; #endif } diff --git a/src/mapi/glapi/glapi_priv.h b/src/mapi/glapi/glapi_priv.h index 92925faacca..d3682603d6f 100644 --- a/src/mapi/glapi/glapi_priv.h +++ b/src/mapi/glapi/glapi_priv.h @@ -86,10 +86,8 @@ get_entrypoint_address(unsigned int functionOffset); #if defined(USE_X86_ASM) # if defined(GLX_USE_TLS) # define DISPATCH_FUNCTION_SIZE 16 -# elif defined(THREADS) -# define DISPATCH_FUNCTION_SIZE 32 # else -# define DISPATCH_FUNCTION_SIZE 16 +# define DISPATCH_FUNCTION_SIZE 32 # endif #endif |