/* ****************** Common header file ****************** */ /* Before include this file, you may define MYDEBUG */ #ifndef _MYHEAD_H_ #define _MYHEAD_H_ /*ANSI headers */ #include <assert.h> #include <ctype.h> #include <errno.h> #include <float.h> #include <limits.h> #include <locale.h> #include <math.h> #include <setjmp.h> #include <signal.h> #include <stdarg.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> /*Linux headers */ #include <fcntl.h> #include <getopt.h> #include <signal.h> #include <sys/types.h> #include <sys/ioctl.h> #include <sys/ipc.h> #include <sys/msg.h> #include <sys/mman.h> #include <sys/stat.h> #include <sys/time.h> #include <unistd.h> #include <termios.h> extern char *optarg; extern int optind, opterr, optopt; extern int errno; /*application libraries headers*/ //#include <readline/readline.h> //#include <readline/history.h> //char * readline (const char *prompt); //#define MYDEBUG #if defined MYDEBUG //#define PDEBUG(fmt, args...) printf(fmt, ##args) #define PDEBUG(args...) fprintf(stderr,args) #define PFUNC() PDEBUG("<%s:%s> enter\n", __FILE__, __FUNCTION__); #define PAUSE() do{fflush(stdin); fprintf(stderr,"<%s><%d>press any key to continue\n",__FUNCTION__, __LINE__); getchar();}while(0) #define PLINE fprintf(stderr,"<%s:%s:%d>\n", __FILE__, __FUNCTION__, __LINE__) #define PDEBUG_ONCE(args...) { \ static int once=0; \ if(once==0) fprintf(stderr,args); \ once=1; \ } #else #define PDEBUG(fmt, args...) #define PFUNC() #define PLINE #define PAUSE() #define PDEBUG_ONCE(args...) #endif #define PRINT_VERSION printf("Build time: %s, %s\n", __DATE__, __TIME__) #endif
Debug头文件
最新推荐文章于 2020-06-18 09:33:14 发布