2012年7月20日

多等级debug输出的简单例子(c编译器: gcc(支持C99标准))

摘要: 利用C99标准支持的__VA_ARGS__宏 (C99 宏支持取参数 #define Macro(...) __VA_ARGS__ 使用宏的时候,参数如果不写,宏里用 #,## 这样的东西会扩展成空串。(以前会出错的)),做的带多等级debug输出的简单例子,便于程序开发!#include <stdio.h>#include <stdarg.h>#define BUFFER_SIZE 1024#define DEBUG_LEVEL 4typedef enum{ DEBUG_LEVEL_ERROR=0, DEBUG_LEVEL_WARNING, DEBUG_LEVEL_N 阅读全文

posted @ 2012-07-20 16:58 lin_victor 阅读(573) 评论(1) 推荐(0) 编辑

导航