optimize size, and make debug and ftl stuff optional

This commit is contained in:
David Voswinkel
2009-08-01 16:59:31 +02:00
parent c5e72c48eb
commit 1539ff6111
12 changed files with 1729 additions and 1639 deletions

View File

@@ -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