optimize size, and make debug and ftl stuff optional
This commit is contained in:
@@ -31,12 +31,10 @@ extern FILE uart_stdout;
|
||||
extern int debug_level; /* the higher, the more messages... */
|
||||
|
||||
#if defined(NO_DEBUG) && defined(__GNUC__)
|
||||
/* Nothing. debug has been "defined away" in debug.h already. */
|
||||
#else
|
||||
void debug(int level, char* format, ...) {
|
||||
#ifdef NO_DEBUG
|
||||
/* Empty body, so a good compiler will optimise calls
|
||||
to pmesg away */
|
||||
|
||||
#else
|
||||
va_list args;
|
||||
if (!(debug_level & level))
|
||||
@@ -44,8 +42,8 @@ void debug(int level, char* format, ...) {
|
||||
va_start(args, format);
|
||||
vprintf(format, args);
|
||||
va_end(args);
|
||||
#endif /* NDEBUG */
|
||||
#endif /* NDEBUG && __GNUC__ */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user