From 181ef62460c09a8823bf250fb8f7eb618e627f55 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 25 Jun 2009 00:23:54 +0000 Subject: Fix messaging logic for case of debu disabled git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1944 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/examples/nxflat/nxflat_main.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/nuttx/examples/nxflat/nxflat_main.c b/nuttx/examples/nxflat/nxflat_main.c index 7c03b789d..f8f608488 100644 --- a/nuttx/examples/nxflat/nxflat_main.c +++ b/nuttx/examples/nxflat/nxflat_main.c @@ -38,6 +38,7 @@ ****************************************************************************/ #include +#include #include #include @@ -96,12 +97,22 @@ * output will be synchronous with the debug output. */ -#ifdef CONFIG_DEBUG -# define message dbg -# define err dbg +#ifdef CONFIG_CPP_HAVE_VARARGS +# ifdef CONFIG_DEBUG +# define message(format, arg...) dbg(format, ##arg) +# define err(format, arg...) dbg(format, ##arg) +# else +# define message(format, arg...) printf(format, ##arg) +# define err(format, arg...) fprintf(stderr, format, ##arg) +# endif #else -# define message printf -# define err fprintf(stderr, +# ifdef CONFIG_DEBUG +# define message dbg +# define err dbg +# else +# define message printf +# define err printf +# endif #endif /**************************************************************************** -- cgit v1.2.3