summaryrefslogtreecommitdiff
path: root/nuttx/examples/poll/poll_internal.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-14 21:58:48 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-14 21:58:48 +0000
commit8ef41dcb207514cab2ef5683be26f53091bb94a6 (patch)
tree6683e7f17636acf3e9b492e947d0a0f08caa76bb /nuttx/examples/poll/poll_internal.h
parent095a6f2fb2b290ef133f5c3818e6314b4f71f956 (diff)
downloadpx4-nuttx-8ef41dcb207514cab2ef5683be26f53091bb94a6.tar.gz
px4-nuttx-8ef41dcb207514cab2ef5683be26f53091bb94a6.tar.bz2
px4-nuttx-8ef41dcb207514cab2ef5683be26f53091bb94a6.zip
Changes for clean compilation with ZDS
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1610 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/poll/poll_internal.h')
-rw-r--r--nuttx/examples/poll/poll_internal.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/nuttx/examples/poll/poll_internal.h b/nuttx/examples/poll/poll_internal.h
index 38a5e0f7e..cbf42ac56 100644
--- a/nuttx/examples/poll/poll_internal.h
+++ b/nuttx/examples/poll/poll_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/poll_internal.h
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -73,14 +73,27 @@
/* If debug is enabled, then use lib_rawprintf so that OS debug output and
* the test output are synchronized.
+ *
+ * These macros will differ depending upon if the toolchain supports
+ * macros with a variable number of arguments or not.
*/
-#ifdef CONFIG_DEBUG
-# define message(...) lib_rawprintf(__VA_ARGS__)
-# define msgflush()
+#ifdef CONFIG_CPP_HAVE_VARARGS
+# ifdef CONFIG_DEBUG
+# define message(...) lib_rawprintf(__VA_ARGS__)
+# define msgflush()
+# else
+# define message(...) printf(__VA_ARGS__)
+# define msgflush() fflush(stdout)
+# endif
#else
-# define message(...) printf(__VA_ARGS__)
-# define msgflush() fflush(stdout)
+# ifdef CONFIG_DEBUG
+# define message lib_rawprintf
+# define msgflush()
+# else
+# define message printf
+# define msgflush() fflush(stdout)
+# endif
#endif
#define FIFO_PATH1 "/dev/fifo0"