summaryrefslogtreecommitdiff
path: root/src/mesa/glapi
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/glapi')
-rw-r--r--src/mesa/glapi/descrip.mms39
-rw-r--r--src/mesa/glapi/glapi.c4
-rw-r--r--src/mesa/glapi/glthread.c6
-rw-r--r--src/mesa/glapi/glthread.h48
4 files changed, 50 insertions, 47 deletions
diff --git a/src/mesa/glapi/descrip.mms b/src/mesa/glapi/descrip.mms
deleted file mode 100644
index ee96baa6fc..0000000000
--- a/src/mesa/glapi/descrip.mms
+++ /dev/null
@@ -1,39 +0,0 @@
-# Makefile for core library for VMS
-# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
-# Last revision : 29 September 2008
-
-.first
- define gl [---.include.gl]
- define main [-.main]
-
-.include [---]mms-config.
-
-##### MACROS #####
-
-VPATH = RCS
-
-INCDIR = [---.include],[-.main]
-LIBDIR = [---.lib]
-CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
-
-SOURCES = glapi.c glthread.c glapi_getproc.c
-
-OBJECTS = glapi.obj,glthread.obj,glapi_getproc.obj
-
-##### RULES #####
-
-VERSION=Mesa V3.4
-
-##### TARGETS #####
-# Make the library
-$(LIBDIR)$(GL_LIB) : $(OBJECTS)
- @ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
-
-clean :
- purge
- delete *.obj;*
-
-glapi.obj : glapi.c
-
-glthread.obj : glthread.c
-glapi_getproc.obj : glapi_getproc.c
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index c3ebf60719..9b5144a88b 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -98,6 +98,7 @@ _glapi_set_warning_func( _glapi_warning_func func )
static GLboolean
warn(void)
{
+#if !defined(_WIN32_WCE)
if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG"))
&& warning_func) {
return GL_TRUE;
@@ -105,6 +106,9 @@ warn(void)
else {
return GL_FALSE;
}
+#else
+ return GL_FALSE;
+#endif
}
diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c
index b818f4e26e..56ddf7c25a 100644
--- a/src/mesa/glapi/glthread.c
+++ b/src/mesa/glapi/glthread.c
@@ -25,16 +25,14 @@
/*
* XXX There's probably some work to do in order to make this file
- * truly reusable outside of Mesa.
+ * truly reusable outside of Mesa. First, the glheader.h include must go.
*/
-
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
-#include <stdlib.h>
-#include <stdio.h>
+#include "main/glheader.h"
#include "glthread.h"
diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h
index e2765cebb1..ad2a63584b 100644
--- a/src/mesa/glapi/glthread.h
+++ b/src/mesa/glapi/glthread.h
@@ -116,9 +116,49 @@ typedef pthread_mutex_t _glthread_Mutex;
#define _glthread_UNLOCK_MUTEX(name) \
(void) pthread_mutex_unlock(&(name))
-#endif /* PTHREADS */
+typedef pthread_cond_t _glthread_Cond;
+#define _glthread_DECLARE_STATIC_COND(name) \
+ static _glthread_Cond name = PTHREAD_COND_INITIALIZER
+#define _glthread_INIT_COND(cond) \
+ pthread_cond_init(&(cond), NULL)
+
+#define _glthread_DESTROY_COND(name) \
+ pthread_cond_destroy(&(name))
+
+#define _glthread_COND_WAIT(cond, mutex) \
+ pthread_cond_wait(&(cond), &(mutex))
+
+#define _glthread_COND_SIGNAL(cond) \
+ pthread_cond_signal(&(cond))
+
+#define _glthread_COND_BROADCAST(cond) \
+ pthread_cond_broadcast(&(cond))
+
+
+#else /* PTHREADS */
+
+typedef unsigned int _glthread_Cond;
+#define _glthread_DECLARE_STATIC_COND(name) \
+// #warning Condition variables not implemented.
+
+#define _glthread_INIT_COND(cond) \
+ ASSERT(0);
+
+#define _glthread_DESTROY_COND(name) \
+ ASSERT(0);
+
+#define _glthread_COND_WAIT(cond, mutex) \
+ ASSERT(0);
+
+#define _glthread_COND_SIGNAL(cond) \
+ ASSERT(0);
+
+#define _glthread_COND_BROADCAST(cond) \
+ ASSERT(0);
+
+#endif
/*
@@ -259,11 +299,11 @@ typedef benaphore _glthread_Mutex;
* THREADS not defined
*/
-typedef int _glthread_TSD;
+typedef GLuint _glthread_TSD;
-typedef int _glthread_Thread;
+typedef GLuint _glthread_Thread;
-typedef int _glthread_Mutex;
+typedef GLuint _glthread_Mutex;
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0