自己想想啥 這也不是什么難題^_^
- #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
復制代碼
我這里是宏,你也可以用函數(shù) |
http://bbs./thread-1551843-1-1.html
|