调试技巧:封装printf打印调试信息和宏定义开关

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/biqioso/article/details/83989867
/* #define DEBUG */

#ifdef DEBUG
    #define DEBUG_ERR(format, ...) \
    do{ \
        printf("\r\n"); \
        printf("FILE: "__FILE__", LINE: %05d: "format,__LINE__,##__VA_ARGS__); \
        printf("\r\n"); \
    } while (0)
#else
    #define DEBUG_ERR(format, ...)
#endif

猜你喜欢

转载自blog.csdn.net/biqioso/article/details/83989867