mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-02 01:18:04 +08:00
feat(assert): support format string in assert message (#5392)
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
@@ -42,12 +42,12 @@ extern "C" {
|
|||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define LV_ASSERT_MSG(expr, msg) \
|
#define LV_ASSERT_MSG(expr, format, ...) \
|
||||||
do { \
|
do { \
|
||||||
if(!(expr)) { \
|
if(!(expr)) { \
|
||||||
LV_LOG_ERROR("Asserted at expression: %s (%s)", #expr, msg); \
|
LV_LOG_ERROR("Asserted at expression: %s " format , #expr, ##__VA_ARGS__); \
|
||||||
LV_ASSERT_HANDLER \
|
LV_ASSERT_HANDLER \
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
/*-----------------
|
/*-----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user