aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/tinygl-0.4-ugfx/src/msghandling.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-08-20 17:44:40 +1000
committerinmarket <andrewh@inmarket.com.au>2014-08-20 17:44:40 +1000
commit2b47a0708602b45b0b5db120a496bf92232aa4b1 (patch)
tree6c5965b6bf1d109b853efe64777bbc7ee5548882 /3rdparty/tinygl-0.4-ugfx/src/msghandling.c
parentc06bff3304ed234c3a7f96fd049755ac59228ef7 (diff)
parent0f3f8f68f87233bf59c3fa68c3dfe1f492a1a478 (diff)
downloaduGFX-2b47a0708602b45b0b5db120a496bf92232aa4b1.tar.gz
uGFX-2b47a0708602b45b0b5db120a496bf92232aa4b1.tar.bz2
uGFX-2b47a0708602b45b0b5db120a496bf92232aa4b1.zip
Merge branch 'master' into newmouse
Diffstat (limited to '3rdparty/tinygl-0.4-ugfx/src/msghandling.c')
-rw-r--r--3rdparty/tinygl-0.4-ugfx/src/msghandling.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/3rdparty/tinygl-0.4-ugfx/src/msghandling.c b/3rdparty/tinygl-0.4-ugfx/src/msghandling.c
new file mode 100644
index 00000000..c5b10614
--- /dev/null
+++ b/3rdparty/tinygl-0.4-ugfx/src/msghandling.c
@@ -0,0 +1,52 @@
+#include <stdarg.h>
+#include <stdio.h>
+
+#define NDEBUG
+
+#ifdef NDEBUG
+#define NO_DEBUG_OUTPUT
+#endif
+
+/* Use this function to output messages when something unexpected
+ happens (which might be an indication of an error). *Don't* use it
+ when there's internal errors in the code - these should be handled
+ by asserts. */
+void
+tgl_warning(const char *format, ...)
+{
+#ifndef NO_DEBUG_OUTPUT
+ va_list args;
+ va_start(args, format);
+ fprintf(stderr, "*WARNING* ");
+ vfprintf(stderr, format, args);
+ va_end(args);
+#endif /* !NO_DEBUG_OUTPUT */
+}
+
+/* This function should be used for debug output only. */
+void
+tgl_trace(const char *format, ...)
+{
+#ifndef NO_DEBUG_OUTPUT
+ va_list args;
+ va_start(args, format);
+ fprintf(stderr, "*DEBUG* ");
+ vfprintf(stderr, format, args);
+ va_end(args);
+#endif /* !NO_DEBUG_OUTPUT */
+}
+
+/* Use this function to output info about things in the code which
+ should be fixed (missing handling of special cases, important
+ features not implemented, known bugs/buglets, ...). */
+void
+tgl_fixme(const char *format, ...)
+{
+#ifndef NO_DEBUG_OUTPUT
+ va_list args;
+ va_start(args, format);
+ fprintf(stderr, "*FIXME* ");
+ vfprintf(stderr, format, args);
+ va_end(args);
+#endif /* !NO_DEBUG_OUTPUT */
+}