Debug头文件

/* ****************** 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值