1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <basic_def.h> #include <all_share.h> #include <stdarg.h> void __debug_printf( char *file, int line, char *fmt, ...){ static char buff[2048]; va_list ap; va_start(ap, fmt); vsprintf( buff, fmt, ap); va_end(ap); printf( "[%s:%d]%s", file, line, buff); }