diff --git a/os/nil/include/nil.h b/os/nil/include/nil.h index c6994dfe1..9d5218198 100644 --- a/os/nil/include/nil.h +++ b/os/nil/include/nil.h @@ -359,11 +359,6 @@ typedef struct { /* Module macros. */ /*===========================================================================*/ -/** - * @brief String quotation macro. - */ -#define __CH_QUOTE(p) #p - /** * @name Threads tables definition macros * @{ @@ -742,11 +737,11 @@ typedef struct { #if !defined(chDbgAssert) #define chDbgAssert(c, r) { \ if (!(c)) \ - chSysHalt("A:"__CH_QUOTE(__FUNCTION__)":"__CH_QUOTE(__LINE__)); \ + chSysHalt(__func__); \ } #endif /* !defined(chDbgAssert) */ #else /* !NIL_CFG_ENABLE_ASSERTS */ -#define chDbgAssert(c, r) /*{(void)(c);}*/ +#define chDbgAssert(c, r) {if (0) (void)(c);} #endif /* !NIL_CFG_ENABLE_ASSERTS */ /** @} */ diff --git a/os/rt/include/chdebug.h b/os/rt/include/chdebug.h index 0fdc865eb..63440e4ee 100644 --- a/os/rt/include/chdebug.h +++ b/os/rt/include/chdebug.h @@ -121,8 +121,6 @@ typedef struct { /* Module macros. */ /*===========================================================================*/ -#define __QUOTE_THIS(p) #p - #if CH_DBG_SYSTEM_STATE_CHECK #define _dbg_enter_lock() (ch.dbg_lock_cnt = 1) #define _dbg_leave_lock() (ch.dbg_lock_cnt = 0) @@ -170,12 +168,12 @@ typedef struct { #if !defined(chDbgCheck) #define chDbgCheck(c) { \ if (!(c)) \ - chSysHalt("C:"__QUOTE_THIS(__FUNCTION__)":"__QUOTE_THIS(__LINE__)); \ + chSysHalt(__func__); \ } #endif /* !defined(chDbgCheck) */ #else /* !CH_DBG_ENABLE_CHECKS */ -#define chDbgCheck(c) /*{(void)(c);}*/ +#define chDbgCheck(c) {if (0) (void)(c);} #endif /* !CH_DBG_ENABLE_CHECKS */ #if CH_DBG_ENABLE_ASSERTS || defined(__DOXYGEN__) @@ -196,11 +194,11 @@ typedef struct { #if !defined(chDbgAssert) #define chDbgAssert(c, r) { \ if (!(c)) \ - chSysHalt("A:"__QUOTE_THIS(__FUNCTION__)":"__QUOTE_THIS(__LINE__)); \ + chSysHalt(__func__); \ } #endif /* !defined(chDbgAssert) */ #else /* !CH_DBG_ENABLE_ASSERTS */ -#define chDbgAssert(c, r) /*{(void)(c);}*/ +#define chDbgAssert(c, r) {if (0) (void)(c);} #endif /* !CH_DBG_ENABLE_ASSERTS */ /** @} */