diff options
author | Chia-I Wu <[email protected]> | 2010-01-12 11:25:02 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-01-12 11:25:02 +0800 |
commit | 562c127693200822f04a145db50add1be2425d7b (patch) | |
tree | 9441774fb212b17ddf2a364f06abc43f166cc00b /src/mesa/glapi/glapi.c | |
parent | e5d351dcfde58777162552cf5cd2a9cd8299f4cd (diff) | |
parent | 077d6dd7508af88509dd0499c5dfbdaa186b4015 (diff) |
Merge branch 'master' into opengl-es-v2
Conflicts:
src/mesa/main/dd.h
Diffstat (limited to 'src/mesa/glapi/glapi.c')
-rw-r--r-- | src/mesa/glapi/glapi.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index ad72fe48bec..adb47f9fecb 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -73,7 +73,6 @@ #include "glapi/glapioffsets.h" #include "glapi/glapitable.h" - /***** BEGIN NO-OP DISPATCH *****/ static GLboolean WarnFlag = GL_FALSE; @@ -97,22 +96,19 @@ _glapi_set_warning_func( _glapi_warning_func func ) warning_func = func; } -static GLboolean -warn(void) +static int +warn(const char *func) { #if !defined(_WIN32_WCE) if ((WarnFlag || getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) && warning_func) { - return GL_TRUE; - } - else { - return GL_FALSE; + warning_func(NULL, "GL User Error: called without context: %s", func); } -#else - return GL_FALSE; #endif + return 0; } +#ifdef DEBUG #define KEYWORD1 static #define KEYWORD1_ALT static @@ -122,27 +118,34 @@ warn(void) #define F NULL #define DISPATCH(func, args, msg) \ - if (warn()) { \ - warning_func(NULL, "GL User Error: called without context: %s", #func); \ - } + warn(#func); #define RETURN_DISPATCH(func, args, msg) \ - if (warn()) { \ - warning_func(NULL, "GL User Error: called without context: %s", #func); \ - } \ - return 0 + return warn(#func); + +#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 -#define TABLE_ENTRY(name) (_glapi_proc) NoOp##name - static GLint NoOpUnused(void) { - if (warn()) { - warning_func(NULL, "GL User Error: calling extension function without a current context\n"); - } - return 0; + return warn("extension function"); } #include "glapi/glapitemp.h" @@ -237,7 +240,7 @@ PUBLIC void *_glapi_Context = NULL; * We should call this periodically from a function such as glXMakeCurrent * in order to test if multiple threads are being used. */ -void +PUBLIC void _glapi_check_multithread(void) { #if defined(THREADS) && !defined(GLX_USE_TLS) |