#ifndef _GLAPI_H
#define _GLAPI_H
-#define GL_GLEXT_PROTOTYPES
-
#include "glthread.h"
#define _glapi_get_dispatch _mglapi_get_dispatch
#define _glapi_set_context _mglapi_set_context
#define _glapi_get_context _mglapi_get_context
-#define _glapi_Context _mglapi_Context
#define _glapi_Dispatch _mglapi_Dispatch
+#define _glapi_Context _mglapi_Context
#endif
#endif
-/*
- * Number of extension functions which we can dynamically add at runtime.
- */
-#define MAX_EXTENSION_FUNCS 300
-
-
/**
** Define the GET_DISPATCH() and GET_CURRENT_CONTEXT() macros.
**
**/
#if defined (GLX_USE_TLS)
-extern const void *_glapi_Context;
extern const struct _glapi_table *_glapi_Dispatch;
+extern const void *_glapi_Context;
+
extern __thread struct _glapi_table * _glapi_tls_Dispatch
__attribute__((tls_model("initial-exec")));
#else
-extern void *_glapi_Context;
extern struct _glapi_table *_glapi_Dispatch;
+extern void *_glapi_Context;
+
# ifdef THREADS
# define GET_DISPATCH() \
_glapi_get_proc_name(unsigned int offset);
+/*
+ * Number of extension functions which we can dynamically add at runtime.
+ */
+#define MAX_EXTENSION_FUNCS 300
+
+
#endif