嵌入式 不定参数printf

#define DbgPrintf(fmt,args...) printf(fmt, ##args)

#define eric_print(...) {print_current_time();printf(__VA_ARGS__);}

eric_print("%s %d the content of sending is :%s ",__FILE__,__LINE__,buf_tmp);

#ifdef __DEBUG #define __D(fmt, args...) fprintf(stderr, "Font Debug: " fmt, ##args) #else #define __D(fmt, args...) #endif #define __E(fmt, args...) fprintf(stderr, "Font Error: " fmt, ##args)

  1. #ifdef MSG_DEBUG
  2. #define msg_print(...) {print_current_time();printf(__VA_ARGS__);}
  3. #else
  4. #define msg_print(...) ;
  5. #endif

不定参数宏打印信息

#define DbgPrintf(fmt,args...) printf(fmt, ##args) #define eric_print(...) {print_current_time();printf(__VA_ARGS__);} eric_print("%s %d the content of sending is :%s ",__FILE__,__LINE__,buf_tmp); #ifdef __DEBUG #define __D(fmt, args...) fprintf(stderr, "Font Debug: " fmt, ##args) #else #define __D(fmt, args...) #endif #define __E(fmt, args...) fprintf(stderr, "Font Error: " fmt, ##args) #ifdef MSG_DEBUG #define msg_print(...) {print_current_time();printf(__VA_ARGS__);} #else #define msg_print(...) ; #endif 不定参数宏打印信息
经验分享 程序员 微信小程序 职场和发展