diff options
author | Brian Paul <[email protected]> | 2010-01-22 09:32:12 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-01-22 09:32:12 -0700 |
commit | 126aff18aaf7512dfe07e4fd43e21a2ecd3a96ff (patch) | |
tree | 54ec830aeda52163bf3b6cfff3d402e7b2f49ddd /src/mesa/glapi/glapi.c | |
parent | ea5918be0e8bc75086a7e6d4a8c0fa04585028ee (diff) |
glapi: split the no-op dispatch code into new glapi_nop.c file
This unclutters the glapi.c file a bit.
Diffstat (limited to 'src/mesa/glapi/glapi.c')
-rw-r--r-- | src/mesa/glapi/glapi.c | 81 |
1 files changed, 1 insertions, 80 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 35b8df2adf7..469523d57cf 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -73,85 +73,7 @@ #include "glapi/glapioffsets.h" #include "glapi/glapitable.h" -/***** BEGIN NO-OP DISPATCH *****/ - -static GLboolean WarnFlag = GL_FALSE; -static _glapi_warning_func warning_func; - -/* - * Enable/disable printing of warning messages. - */ -PUBLIC void -_glapi_noop_enable_warnings(GLboolean enable) -{ - WarnFlag = enable; -} - -/* - * Register a callback function for reporting errors. - */ -PUBLIC void -_glapi_set_warning_func( _glapi_warning_func func ) -{ - warning_func = func; -} - -static int -warn(const char *func) -{ -#if !defined(_WIN32_WCE) - if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) - && warning_func) { - warning_func(NULL, "GL User Error: called without context: %s", func); - } -#endif - return 0; -} - -#ifdef DEBUG - -#define KEYWORD1 static -#define KEYWORD1_ALT static -#define KEYWORD2 GLAPIENTRY -#define NAME(func) NoOp##func - -#define F NULL - -#define DISPATCH(func, args, msg) \ - warn(#func); - -#define RETURN_DISPATCH(func, args, msg) \ - warn(#func); return 0 - -#define TABLE_ENTRY(name) (_glapi_proc) NoOp##name - -#else - -static void -NoOpGeneric(void) -{ - if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) - && warning_func) { - warning_func(NULL, "GL User Error: calling GL function"); - } -} - -#define TABLE_ENTRY(name) (_glapi_proc) NoOpGeneric - -#endif - -#define DISPATCH_TABLE_NAME __glapi_noop_table -#define UNUSED_TABLE_NAME __unused_noop_functions - -static GLint NoOpUnused(void) -{ - return warn("extension function"); -} - -#include "glapi/glapitemp.h" - -/***** END NO-OP DISPATCH *****/ - +extern _glapi_proc __glapi_noop_table[]; /** @@ -278,7 +200,6 @@ _glapi_check_multithread(void) PUBLIC void _glapi_set_context(void *context) { - (void) __unused_noop_functions; /* silence a warning */ #if defined(GLX_USE_TLS) _glapi_tls_Context = context; #elif defined(THREADS) |