diff options
Diffstat (limited to 'xorg-server/glx/glapi.h')
-rw-r--r-- | xorg-server/glx/glapi.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/xorg-server/glx/glapi.h b/xorg-server/glx/glapi.h index 67bf1f42e..8084e5757 100644 --- a/xorg-server/glx/glapi.h +++ b/xorg-server/glx/glapi.h @@ -44,7 +44,7 @@ #ifndef _GLAPI_H #define _GLAPI_H -#include "u_thread.h" +#include "util/macros.h" #ifdef __cplusplus @@ -76,6 +76,8 @@ struct _glapi_table; typedef void (*_glapi_proc)(void); /* generic function pointer */ +typedef void (*_glapi_nop_handler_proc)(const char *name); + typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...); @@ -123,21 +125,12 @@ _GLAPI_EXPORT extern const void *_glapi_Context; SERVEXTERN struct _glapi_table *_glapi_Dispatch; SERVEXTERN void *_glapi_Context; -# ifdef THREADS - -# define GET_DISPATCH() \ +#define GET_DISPATCH() \ (likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch()) -# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \ +#define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \ (likely(_glapi_Context) ? _glapi_Context : _glapi_get_context()) -# else - -# define GET_DISPATCH() _glapi_Dispatch -# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_Context - -# endif - #endif /* defined (GLX_USE_TLS) */ @@ -188,6 +181,14 @@ extern struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix); +void +_glapi_set_nop_handler(_glapi_nop_handler_proc func); + +/** Return pointer to new dispatch table filled with no-op functions */ +struct _glapi_table * +_glapi_new_nop_table(unsigned num_entries); + + #ifdef __cplusplus } |