TRACEMSG() support for compilers with no variadic macros.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 23 Feb 2006 08:40:33 +0000 (08:40 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 23 Feb 2006 08:40:33 +0000 (08:40 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@542 38d2e660-2303-0410-9eaa-f027e97ec537

cfg/debug.h

index f040b37f831e9057181363c84cdf667f5396effe..73f22eb77393b416b116d85489176645163fc908 100755 (executable)
@@ -17,6 +17,9 @@
 
 /*#*
  *#* $Log$
+ *#* Revision 1.9  2006/02/23 08:40:33  bernie
+ *#* TRACEMSG() support for compilers with no variadic macros.
+ *#*
  *#* Revision 1.8  2006/02/23 08:33:04  bernie
  *#* Fix for compilers without variadic macros support.
  *#*
 
                #if !CONFIG_KDEBUG_DISABLE_TRACE
                        #define TRACE  kprintf("%s()\n", __func__)
-                       #define TRACEMSG(msg,...) kprintf("%s(): " msg, __func__, ## __VA_ARGS__)
+                       #if COMPILER_VARIADIC_MACROS
+                               #define TRACEMSG(msg,...) kprintf("%s(): " msg, __func__, ## __VA_ARGS__)
+                       #else
+                               INLINE void TRACEMSG(const char *fmt, ...)
+                               {
+                                       va_list va;
+                                       va_start(va, fmt);
+                                       kprintf("%s(): ", __func__);
+                                       kvprintf(fmt, va);
+                                       va_end(va);
+                               }
+                       #endif
                #else
                        #define TRACE  do {} while(0)
                        #define TRACEMSG(...)  do {} while(0)