From: bernie Date: Thu, 23 Feb 2006 08:40:33 +0000 (+0000) Subject: TRACEMSG() support for compilers with no variadic macros. X-Git-Tag: 1.0.0~699 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=2af1187034ad89752015b943c639ed180bebfbcf;p=bertos.git TRACEMSG() support for compilers with no variadic macros. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@542 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/cfg/debug.h b/cfg/debug.h index f040b37f..73f22eb7 100755 --- a/cfg/debug.h +++ b/cfg/debug.h @@ -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. *#* @@ -205,7 +208,18 @@ #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)