[Mesa-dev] [PATCH (gles3) 04/20] glsl/standalone_scaffolding: Add stub for _mesa_warning()

Chad Versace chad.versace at linux.intel.com
Mon Jan 21 00:49:16 PST 2013


A subsequent patch will add mesa/main/imports.c as a dependency to the
compiler, which in turn requires that _mesa_warning() be defined.

The real definition of _mesa_warning() is in mesa/main/errors.c, but to
pull that file into the standalone scaffolding would require transitively
pulling in the dispatch tables.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/glsl/standalone_scaffolding.cpp | 18 ++++++++++++++++++
 src/glsl/standalone_scaffolding.h   |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp
index 33d3804..ccf5b4f 100644
--- a/src/glsl/standalone_scaffolding.cpp
+++ b/src/glsl/standalone_scaffolding.cpp
@@ -34,6 +34,24 @@
 #include "ralloc.h"
 
 void
+_mesa_warning(struct gl_context *ctx, const char *fmt, ...)
+{
+    va_list vargs;
+    (void) ctx;
+
+    va_start(vargs, fmt);
+
+    /* This output is not thread-safe, but that's good enough for the
+     * standalone compiler.
+     */
+    fprintf(stderr, "Mesa warning: ");
+    vfprintf(stderr, fmt, vargs);
+    fprintf(stderr, "\n");
+
+    va_end(vargs);
+}
+
+void
 _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
                        struct gl_shader *sh)
 {
diff --git a/src/glsl/standalone_scaffolding.h b/src/glsl/standalone_scaffolding.h
index 41ce35b..096b2f1 100644
--- a/src/glsl/standalone_scaffolding.h
+++ b/src/glsl/standalone_scaffolding.h
@@ -34,6 +34,9 @@
 #include "main/mtypes.h"
 
 extern "C" void
+_mesa_warning(struct gl_context *ctx, const char *fmtString, ... );
+
+extern "C" void
 _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
                        struct gl_shader *sh);
 
-- 
1.8.1.1



More information about the mesa-dev mailing list