summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/glapi/glthread.c44
-rw-r--r--src/mesa/glapi/glthread.h27
2 files changed, 50 insertions, 21 deletions
diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c
index ad6380328df..66f801535e8 100644
--- a/src/mesa/glapi/glthread.c
+++ b/src/mesa/glapi/glthread.c
@@ -1,4 +1,4 @@
-/* $Id: glthread.c,v 1.4 2000/02/10 21:27:25 brianp Exp $ */
+/* $Id: glthread.c,v 1.5 2000/02/10 21:54:06 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -35,18 +35,16 @@
#include "all.h"
#else
#include "glheader.h"
+#include "glthread.h"
#endif
-
/*
* This file should still compile even when THREADS is not defined.
* This is to make things easier to deal with on the makefile scene..
*/
#ifdef THREADS
#include <errno.h>
-#include "glthread.h"
-
/*
* Error messages
@@ -293,6 +291,42 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
#endif /* XTHREAD */
-#endif /* THREADS */
+#else /* THREADS */
+
+
+/*
+ * no-op functions
+ */
+
+unsigned long
+_glthread_GetID(void)
+{
+ return 0;
+}
+
+
+void
+_glthread_InitTSD(_glthread_TSD *tsd)
+{
+ (void) tsd;
+}
+
+
+void *
+_glthread_GetTSD(_glthread_TSD *tsd)
+{
+ (void) tsd;
+ return NULL;
+}
+
+void
+_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
+{
+ (void) tsd;
+ (void) ptr;
+}
+
+
+#endif /* THREADS */
diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h
index 72fe08ff7f9..0891f94df6b 100644
--- a/src/mesa/glapi/glthread.h
+++ b/src/mesa/glapi/glthread.h
@@ -1,4 +1,4 @@
-/* $Id: glthread.h,v 1.3 2000/02/10 21:27:25 brianp Exp $ */
+/* $Id: glthread.h,v 1.4 2000/02/10 21:54:06 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -56,22 +56,19 @@
*
*/
-
-#ifndef GLTHREAD_H
-#define GLTHREAD_H
-
-
/*
* If this file is accidentally included by a non-threaded build,
* it should not cause the build to fail, or otherwise cause problems.
* In general, it should only be included when needed however.
*/
-#ifdef THREADS
-/*
- * It is an error not to select a specific threads API when compiling.
- */
-#if !defined(PTHREADS) && !defined(SOLARIS_THREADS) && !defined(WIN32) && !defined(XTHREADS)
-#error One of PTHREADS, SOLARIS_THREADS, WIN32 or XTHREADS must be defined.
+
+
+#ifndef GLTHREAD_H
+#define GLTHREAD_H
+
+
+#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(XTHREADS)
+#define THREADS
#endif
@@ -85,7 +82,7 @@
* compiler flag. On Solaris with gcc, use -D_REENTRANT to enable
* proper compiling for MT-safe libc etc.
*/
-#ifdef PTHREADS
+#if defined(PTHREADS)
#include <pthread.h> /* POSIX threads headers */
typedef struct {
@@ -204,8 +201,8 @@ typedef xmutex_rec _glthread_Mutex;
-#else /* THREADS */
+#ifndef THREADS
/*
* THREADS not defined
@@ -225,7 +222,6 @@ typedef GLuint _glthread_Mutex;
#define _glthread_UNLOCK_MUTEX(name) (void) name
-
#endif /* THREADS */
@@ -251,6 +247,5 @@ _glthread_SetTSD(_glthread_TSD *, void *);
-
#endif /* THREADS_H */