source: trunk/sys/TinyGL/src/msghandling.c @ 325

Last change on this file since 325 was 1, checked in by alain, 8 years ago

First import

File size: 1.2 KB
RevLine 
[1]1#include <stdarg.h>
2#include <stdio.h>
3
4#define NDEBUG
5
6#ifdef NDEBUG
7#define NO_DEBUG_OUTPUT
8#endif
9
10/* Use this function to output messages when something unexpected
11   happens (which might be an indication of an error). *Don't* use it
12   when there's internal errors in the code - these should be handled
13   by asserts. */
14void
15tgl_warning(const char *format, ...)
16{
17#ifndef NO_DEBUG_OUTPUT
18  va_list args;
19  va_start(args, format);
20  fprintf(stderr, "*WARNING* ");
21  vfprintf(stderr, format, args);
22  va_end(args);
23#endif /* !NO_DEBUG_OUTPUT */
24}
25
26/* This function should be used for debug output only. */
27void
28tgl_trace(const char *format, ...)
29{
30#ifndef NO_DEBUG_OUTPUT
31  va_list args;
32  va_start(args, format);
33  fprintf(stderr, "*DEBUG* ");
34  vfprintf(stderr, format, args);
35  va_end(args);
36#endif /* !NO_DEBUG_OUTPUT */
37}
38
39/* Use this function to output info about things in the code which
40   should be fixed (missing handling of special cases, important
41   features not implemented, known bugs/buglets, ...). */
42void
43tgl_fixme(const char *format, ...)
44{
45#ifndef NO_DEBUG_OUTPUT
46  va_list args;
47  va_start(args, format);
48  fprintf(stderr, "*FIXME* ");
49  vfprintf(stderr, format, args);
50  va_end(args);
51#endif /* !NO_DEBUG_OUTPUT */
52}
Note: See TracBrowser for help on using the repository browser.