奇怪编译报错!
#define LOGE(fmt, ...) do { \
char *buf = (char*)malloc(1024); \
if (buf) { \
char *file; \
memset(buf, 0, 1024); \
file = (char*)strrchr(__FILE__, '/'); \
if(!file) { \
file = (char*)strrchr(__FILE__, '\\'); \
} \
snprintf(buf, 1023, "[tid:%d fn:%s ln:%d %s] ", (int)pthread_self(), __FUNCTION__, __LINE__, (NULL != file) ? (file + 1) : __FILE__); \
snprintf(buf + strlen(buf), 1023 - strlen(buf), fmt, ##__VA_ARGS__); \
//printf("%s\n", buf); \ <----------奇怪编译报错!
printf("%s\n", buf); \
free(buf);\
} \
} while(0);
posted on 2023-11-25 14:52 huangguanyuan 阅读(8) 评论(0) 编辑 收藏 举报