summaryrefslogtreecommitdiffstats
path: root/src/mapi
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2012-09-18 22:09:26 -0700
committerMatt Turner <mattst88@gmail.com>2012-10-01 15:23:04 -0700
commit814345f54b74eee2597cf84f3c34817488f07522 (patch)
tree5a425f04b4fed603ac58f7f47a3faeaf79bc487c /src/mapi
parentb6651ae6ad314a93287e431a41f5c7a8f8f6c855 (diff)
downloadexternal_mesa3d-814345f54b74eee2597cf84f3c34817488f07522.zip
external_mesa3d-814345f54b74eee2597cf84f3c34817488f07522.tar.gz
external_mesa3d-814345f54b74eee2597cf84f3c34817488f07522.tar.bz2
build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definition
Diffstat (limited to 'src/mapi')
-rw-r--r--src/mapi/glapi/gen/gl_SPARC_asm.py2
-rw-r--r--src/mapi/glapi/gen/gl_x86-64_asm.py6
-rw-r--r--src/mapi/glapi/gen/gl_x86_asm.py6
-rw-r--r--src/mapi/glapi/glapi_entrypoint.c6
-rw-r--r--src/mapi/mapi/stub.c2
-rw-r--r--src/mapi/mapi/u_thread.h8
6 files changed, 15 insertions, 15 deletions
diff --git a/src/mapi/glapi/gen/gl_SPARC_asm.py b/src/mapi/glapi/gen/gl_SPARC_asm.py
index 400e684..5539596 100644
--- a/src/mapi/glapi/gen/gl_SPARC_asm.py
+++ b/src/mapi/glapi/gen/gl_SPARC_asm.py
@@ -120,7 +120,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '\t sethi\tGL_OFF(off), %g3;\t\t\t\\'
print '\t.size\tfn,.-fn;'
print ''
- print '#elif defined(PTHREADS)'
+ print '#elif defined(HAVE_PTHREAD)'
print ''
print '\t/* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */'
print '\t/* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */'
diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py b/src/mapi/glapi/gen/gl_x86-64_asm.py
index 3ef5e08..9a085ea 100644
--- a/src/mapi/glapi/gen/gl_x86-64_asm.py
+++ b/src/mapi/glapi/gen/gl_x86-64_asm.py
@@ -138,7 +138,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))'
print '# endif'
print ''
- print '#if defined(PTHREADS) || defined(_WIN32)'
+ print '#if defined(HAVE_PTHREAD) || defined(_WIN32)'
print '# define THREADS'
print '#endif'
print ''
@@ -158,7 +158,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '\tret'
print '\t.size\t_x86_64_get_dispatch, .-_x86_64_get_dispatch'
print ''
- print '#elif defined(PTHREADS)'
+ print '#elif defined(HAVE_PTHREAD)'
print ''
print '\t.extern\t_glapi_Dispatch'
print '\t.extern\t_gl_DispatchTSD'
@@ -251,7 +251,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '\tcall\t_x86_64_get_dispatch@PLT'
print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
print '\tjmp\t*%r11'
- print '#elif defined(PTHREADS)'
+ print '#elif defined(HAVE_PTHREAD)'
save_all_regs(registers)
print '\tcall\t_x86_64_get_dispatch@PLT'
diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py
index 095edcd..5eaa340 100644
--- a/src/mapi/glapi/gen/gl_x86_asm.py
+++ b/src/mapi/glapi/gen/gl_x86_asm.py
@@ -78,7 +78,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '#define GLOBL_FN(x) GLOBL x'
print '#endif'
print ''
- print '#if defined(PTHREADS) || defined(_WIN32)'
+ print '#if defined(HAVE_PTHREAD) || defined(_WIN32)'
print '# define THREADS'
print '#endif'
print ''
@@ -98,7 +98,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '\tCTX_INSNS ; \\'
print '\tJMP(GL_OFFSET(off))'
print ''
- print '#elif defined(PTHREADS)'
+ print '#elif defined(HAVE_PTHREAD)'
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\\'
@@ -152,7 +152,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '\tmovl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax'
print '\tret'
print ''
- print '#elif defined(PTHREADS)'
+ print '#elif defined(HAVE_PTHREAD)'
print 'EXTERN GLNAME(_glapi_Dispatch)'
print 'EXTERN GLNAME(_gl_DispatchTSD)'
print 'EXTERN GLNAME(pthread_getspecific)'
diff --git a/src/mapi/glapi/glapi_entrypoint.c b/src/mapi/glapi/glapi_entrypoint.c
index 993ccb94..7a0eb35 100644
--- a/src/mapi/glapi/glapi_entrypoint.c
+++ b/src/mapi/glapi/glapi_entrypoint.c
@@ -136,7 +136,7 @@ extern void __glapi_sparc_icache_flush(unsigned int *);
static void
init_glapi_relocs( void )
{
-#if defined(PTHREADS) || defined(GLX_USE_TLS)
+#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS)
static const unsigned int template[] = {
#ifdef GLX_USE_TLS
0x05000000, /* sethi %hi(_glapi_tls_Dispatch), %g2 */
@@ -266,7 +266,7 @@ init_glapi_relocs( void )
_glapi_proc
generate_entrypoint(GLuint functionOffset)
{
-#if defined(PTHREADS) || defined(GLX_USE_TLS)
+#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS)
static const unsigned int template[] = {
0x07000000, /* sethi %hi(0), %g3 */
0x8210000f, /* mov %o7, %g1 */
@@ -337,7 +337,7 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset)
void
init_glapi_relocs_once( void )
{
-#if defined(PTHREADS) || defined(GLX_USE_TLS)
+#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS)
static pthread_once_t once_control = PTHREAD_ONCE_INIT;
pthread_once( & once_control, init_glapi_relocs );
#endif
diff --git a/src/mapi/mapi/stub.c b/src/mapi/mapi/stub.c
index 99b475a..6fb8556 100644
--- a/src/mapi/mapi/stub.c
+++ b/src/mapi/mapi/stub.c
@@ -55,7 +55,7 @@ static int next_dynamic_slot = MAPI_TABLE_NUM_STATIC;
void
stub_init_once(void)
{
-#ifdef PTHREADS
+#ifdef HAVE_PTHREAD
static pthread_once_t once = PTHREAD_ONCE_INIT;
pthread_once(&once, entry_patch_public);
#else
diff --git a/src/mapi/mapi/u_thread.h b/src/mapi/mapi/u_thread.h
index e53f872..a5e5043 100644
--- a/src/mapi/mapi/u_thread.h
+++ b/src/mapi/mapi/u_thread.h
@@ -46,14 +46,14 @@
#include <stdlib.h>
#include "u_compiler.h"
-#if defined(PTHREADS)
+#if defined(HAVE_PTHREAD)
#include <pthread.h> /* POSIX threads headers */
#endif
#ifdef _WIN32
#include <windows.h>
#endif
-#if defined(PTHREADS) || defined(_WIN32)
+#if defined(HAVE_PTHREAD) || defined(_WIN32)
#ifndef THREADS
#define THREADS
#endif
@@ -88,7 +88,7 @@ extern "C" {
* compiler flag. On Solaris with gcc, use -D_REENTRANT to enable
* proper compiling for MT-safe libc etc.
*/
-#if defined(PTHREADS)
+#if defined(HAVE_PTHREAD)
struct u_tsd {
pthread_key_t key;
@@ -145,7 +145,7 @@ u_tsd_set(struct u_tsd *tsd, void *ptr)
}
}
-#endif /* PTHREADS */
+#endif /* HAVE_PTHREAD */
/*