hush: Fix printf debug macro in hush.c so that it usable in U-Boot

This patch changes the debug_printf() marco for U-Boot in hush.c and
moves the definition of DEBUG_SHELL to a place that is actually compiled
under U-Boot.

Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Stefan Roese 2008-08-19 14:57:55 +02:00 committed by Wolfgang Denk
parent 8f2b457ef2
commit 4cacf7c646
1 changed files with 6 additions and 2 deletions

View File

@ -115,7 +115,6 @@ extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /
#include <signal.h> #include <signal.h>
/* #include <dmalloc.h> */ /* #include <dmalloc.h> */
/* #define DEBUG_SHELL */
#if 1 #if 1
#include "busybox.h" #include "busybox.h"
@ -360,6 +359,11 @@ struct built_in_command {
}; };
#endif #endif
/* define DEBUG_SHELL for debugging output (obviously ;-)) */
#if 0
#define DEBUG_SHELL
#endif
/* This should be in utility.c */ /* This should be in utility.c */
#ifdef DEBUG_SHELL #ifdef DEBUG_SHELL
#ifndef __U_BOOT__ #ifndef __U_BOOT__
@ -371,7 +375,7 @@ static void debug_printf(const char *format, ...)
va_end(args); va_end(args);
} }
#else #else
#define debug_printf printf /* U-Boot debug flag */ #define debug_printf(fmt,args...) printf (fmt ,##args)
#endif #endif
#else #else
static inline void debug_printf(const char *format, ...) { } static inline void debug_printf(const char *format, ...) { }