summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-06-25 00:23:54 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-06-25 00:23:54 +0000
commit181ef62460c09a8823bf250fb8f7eb618e627f55 (patch)
treedcedec070acaea357a8816e45f20ef6061eda0d8
parentdfab3df14acb516e4a7e127b4ced4d1d755fcb59 (diff)
downloadnuttx-181ef62460c09a8823bf250fb8f7eb618e627f55.tar.gz
nuttx-181ef62460c09a8823bf250fb8f7eb618e627f55.tar.bz2
nuttx-181ef62460c09a8823bf250fb8f7eb618e627f55.zip
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
-rw-r--r--nuttx/examples/nxflat/nxflat_main.c21
1 files 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 <nuttx/config.h>
+#include <nuttx/compiler.h>
#include <sys/types.h>
#include <sys/mount.h>
@@ -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
/****************************************************************************