feat(assert): support format string in assert message (#5392)

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Neo Xu
2024-01-19 17:39:10 +08:00
committed by GitHub
parent 214d72da88
commit 24115615bc

View File

@@ -42,12 +42,12 @@ extern "C" {
} \
} while(0)
#define LV_ASSERT_MSG(expr, msg) \
do { \
if(!(expr)) { \
LV_LOG_ERROR("Asserted at expression: %s (%s)", #expr, msg); \
LV_ASSERT_HANDLER \
} \
#define LV_ASSERT_MSG(expr, format, ...) \
do { \
if(!(expr)) { \
LV_LOG_ERROR("Asserted at expression: %s " format , #expr, ##__VA_ARGS__); \
LV_ASSERT_HANDLER \
} \
} while(0)
/*-----------------