自己想想啥 这也不是什么难题^_^
- #ifdef DEBUG_ON
- #define DEBUG(fmt, args...) fprintf(stderr, fmt, ##args)
- #else
- #define DEBUG(fmt, args...)
- #endif
-
- #ifdef DEBUG_ON
- #define TRACE() fprintf(stderr,"%s\t%s\t%d\t%s\n",__FILE__,__FUNCTION__,__LINE__,__TIME__)
- #else
- #define TRACE()
- #endif
复制代码
我这里是宏,你也可以用函数 |
http://bbs./thread-1551843-1-1.html
|