X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmapi%2Ftable.c;h=748750197c629817424bc48188b289f30176bd5f;hb=a8e2d79e0228106d11b6ceeb38f4ffb587f0a819;hp=0d28666181b5caf35404dd28666b82aa4caac51c;hpb=3998cfa933dcd9134b75d9f0ae2c9cfcd6f2ee45;p=mesa.git diff --git a/src/mapi/table.c b/src/mapi/table.c index 0d28666181b..748750197c6 100644 --- a/src/mapi/table.c +++ b/src/mapi/table.c @@ -30,16 +30,29 @@ #include "table.h" +static nop_handler_proc nop_handler = NULL; + +void +table_set_noop_handler(nop_handler_proc func) +{ + nop_handler = func; +} + static void noop_warn(const char *name) { - static int debug = -1; + if (nop_handler) { + nop_handler(name); + } + else { + static int debug = -1; - if (debug < 0) - debug = (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")); + if (debug < 0) + debug = (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")); - if (debug) - fprintf(stderr, "%s is no-op\n", name); + if (debug) + fprintf(stderr, "%s is no-op\n", name); + } } static int