#ifndef WIN32 #define DBG_OUT(args...) \ do{ \ char buf[1024],line[512],file[512]; \ char *p=file,*q; \ sprintf(buf,args); \ sprintf(line,"%s,%d",__FUNCTION__,__LINE__); \ sprintf(file,"%s",__FILE__); \ q = file+strlen(file); \ while(('/' != *q) && (p != q)) q--; \ while(*q) *p++ = *q++; *p='\0'; \ fprintf(stderr,"[%s,%s],%s",file,line,buf); \ }while(0) #else #define DBG_OUT(x,...) \ do{ \ char buf[1024],line[512],file[512]; \ char *p=file,*q; \ sprintf(buf,x,__VA_ARGS__); \ sprintf(line,"%s,%d",__FUNCTION__,__LINE__); \ sprintf(file,"%s",__FILE__); \ q = file+strlen(file); \ while(('\\' != *q) && (p != q)) q--; \ q++; \ while(*q) *p++ = *q++; *p='\0'; \ fprintf(stderr,"[%s,%s] %s",file,line,buf); \ }while(0) #endif