summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarmink <[email protected]>2020-02-26 10:01:49 +0800
committerarmink <[email protected]>2020-02-26 10:01:49 +0800
commitc2f15ae1cc446ef369217b0687caef350ee47a4e (patch)
tree5d53c38a746598466b34ebea17559b4910c2bb3d
parent19dd40440f91b86a8a66e47dec1dd13ff34defc1 (diff)
[rtdbg] Add for cpp support.
-rw-r--r--include/rtdbg.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/rtdbg.h b/include/rtdbg.h
index a2dfbd9697..be5a57f312 100644
--- a/include/rtdbg.h
+++ b/include/rtdbg.h
@@ -32,6 +32,10 @@
#include <rtconfig.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* the debug log will force enable when RT_DEBUG macro is defined */
#if defined(RT_DEBUG) && !defined(DBG_ENABLE)
#define DBG_ENABLE
@@ -91,13 +95,13 @@
#ifdef DBG_COLOR
#define _DBG_COLOR(n) rt_kprintf("\033["#n"m")
#define _DBG_LOG_HDR(lvl_name, color_n) \
- rt_kprintf("\033["#color_n"m["lvl_name"/"DBG_SECTION_NAME"] ")
+ rt_kprintf("\033["#color_n"m[" lvl_name "/" DBG_SECTION_NAME "] ")
#define _DBG_LOG_X_END \
rt_kprintf("\033[0m\n")
#else
#define _DBG_COLOR(n)
#define _DBG_LOG_HDR(lvl_name, color_n) \
- rt_kprintf("["lvl_name"/"DBG_SECTION_NAME"] ")
+ rt_kprintf("[" lvl_name "/" DBG_SECTION_NAME "] ")
#define _DBG_LOG_X_END \
rt_kprintf("\n")
#endif /* DBG_COLOR */
@@ -176,4 +180,8 @@
#endif /* defined(RT_USING_ULOG) && define(DBG_ENABLE) */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* RT_DBG_H__ */