(void)0U : assert_failed((char *)__FILE__, __LINE__)) void assert_failed(char *file, uint32_t line); #else #define assert_param(expr) ((void)0U) #endif 也就是 若定义了USE_FULL_ASSERT 会比较expr的值 是1就OK 是0就调函数! 若没有定义 就空空如也 也不必写函数 在main.c ...
elog_assert_hook(#EXPR, __FUNCTION__, __LINE__); \ } \ } #else #define ELOG_ASSERT(EXPR) ((void)0); #endif 如果定义了ELOG_ASSERT_ENABLE就执行 如果没有定义ELOG_ASSERT_ENABLE就啥也不做 执行什么? #define ELOG_ASSERT(EXPR) if (!(EXPR)) { if (elog_assert_hook == NULL) ...
I cannot assert oneself can overcome all sorts of shortcomings, because the perseverance is insufficient, but may rely on that positive upward enthusiasm to urge on oneself, gradually, can raise slowly, the full use always cared about supports the superiority which I the huge relatives and friends...
printf("(%s) has assert failed at %s:%ld.", #EXPR, __FUNCTION__, __LINE__); \ } else { \ g_check_hook(#EXPR, __FUNCTION__, __LINE__); \ } \ } \ else printf("(%s) has successed\r\n", #EXPR); \ }while(0); 【注意这里:最后一行 不能再有 \ 了 否则会认为后面还是...