aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mapi/glapi/gen
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mapi/glapi/gen')
-rwxr-xr-xmesalib/src/mapi/glapi/gen/gl_enums.py4
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_x86-64_asm.py6
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_x86_asm.py14
3 files changed, 5 insertions, 19 deletions
diff --git a/mesalib/src/mapi/glapi/gen/gl_enums.py b/mesalib/src/mapi/glapi/gen/gl_enums.py
index 3262bab0f..a756ad971 100755
--- a/mesalib/src/mapi/glapi/gen/gl_enums.py
+++ b/mesalib/src/mapi/glapi/gen/gl_enums.py
@@ -83,7 +83,7 @@ const char *_mesa_lookup_enum_by_nr( int nr )
STATIC_ASSERT(sizeof(enum_string_table) < (1 << 16));
elt = bsearch(& nr, enum_string_table_offsets,
- Elements(enum_string_table_offsets),
+ ARRAY_SIZE(enum_string_table_offsets),
sizeof(enum_string_table_offsets[0]),
(cfunc) compar_nr);
@@ -127,7 +127,7 @@ static const char *prim_names[PRIM_MAX+3] = {
const char *
_mesa_lookup_prim_by_nr(GLuint nr)
{
- if (nr < Elements(prim_names))
+ if (nr < ARRAY_SIZE(prim_names))
return prim_names[nr];
else
return "invalid mode";
diff --git a/mesalib/src/mapi/glapi/gen/gl_x86-64_asm.py b/mesalib/src/mapi/glapi/gen/gl_x86-64_asm.py
index 19e0e15b0..5a69e0343 100644
--- a/mesalib/src/mapi/glapi/gen/gl_x86-64_asm.py
+++ b/mesalib/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/mesalib/src/mapi/glapi/gen/gl_x86_asm.py b/mesalib/src/mapi/glapi/gen/gl_x86_asm.py
index d87d0bd24..f855dbaaa 100644
--- a/mesalib/src/mapi/glapi/gen/gl_x86_asm.py
+++ b/mesalib/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 ''