Chinaunix首页 | 论坛 | 博客
  • 博客访问: 105502
  • 博文数量: 23
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 235
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-19 22:44
文章分类

全部博文(23)

文章存档

2011年(1)

2008年(1)

2007年(21)

我的朋友
最近访客

分类: C/C++

2007-04-30 18:13:18

For Mips-gcc arm-gcc等等.


//////////////////////////////////////////////////////////////

/////////////////My test app to the Avhdd////////////////////

/////////////////////////////////////////////////////////////

#ifndef __MY__DEBUG__
#define __MY__DEBUG__

#ifndef zeroman
#define zeroman
#endif

#ifdef zeroman
//#include


/*************************************************************************
 * color**************************************************************************/

#define S_BLACK "30"
#define S_RED "31"
#define S_YELLOW "33"
#define S_GREEN "32"
#define S_BLUE "34"
#define S_BROWN "35"
#define S_MEGEN "36"
#define S_WHITE "37"
#define S_GRAY "38"
#define HI_WHI "58"
#define HI_RED "39"
#define HI_YEL "52"
#define HI_GRE "51"
#define HI_BLU "53"
#define HI_BRO "54"
#define HI_MEG "55"
#define SETCOLOR(color) printf("\033[0;"##color##"m")
#define RESETCOLOR() printf("\033[0;m")
#define MOVETOXY(x,y) printf("\033["##x##";"##y##"H")
/*************************************************************************
 * color**************************************************************************/



#define PT(X) { SETCOLOR(S_YELLOW);printf("Func:%-10s",__func__); \
                SETCOLOR(S_BROWN);printf("Line:%-5d",__LINE__); \
                SETCOLOR(S_MEGEN);printf("File:%-10s", __FILE__); \
                RESETCOLOR(); printf("Info:"##X##"\n"); \
              }
                //getchar(); \



#define ERRX(X) {PT(X); \
                 printf("\tThis error causing program exit.\n"); \
                 exit(-1); \
                }

#define ERR(X) PT(X)

#else
#define PT(X)
#define ERRX(X)
#define ERR(X)
#endif



#endif


for gcc4.1


//////////////////////////////////////////////////////////////

/////////////////My test app to the Avhdd////////////////////

/////////////////////////////////////////////////////////////

#ifndef __MY__DEBUG__
#define __MY__DEBUG__

#ifndef zeroman
#define zeroman
#endif

#ifdef zeroman
//#include


/*************************************************************************
 * color**************************************************************************/

#define S_BLACK 30
#define S_RED 31
#define S_YELLOW 33
#define S_GREEN 32
#define S_BLUE 34
#define S_BROWN 35
#define S_MEGEN 36
#define S_WHITE 37
#define S_GRAY 38
#define HI_WHI 58
#define HI_RED 39
#define HI_YEL 52
#define HI_GRE 51
#define HI_BLU 53
#define HI_BRO 54
#define HI_MEG 55
#define SETCOLOR(color) printf("\033[0;"#color"m")
#define RESETCOLOR() printf("\033[0;58m")
#define MOVETOXY(x,y) printf("\033["#x";"#y"H")
/*************************************************************************
 * color**************************************************************************/



#define PT(X) { SETCOLOR(33);printf("Func:%-10s",__func__); \
                SETCOLOR(35);printf("Line:%-5d",__LINE__); \
                SETCOLOR(36);printf("File:%-10s", __FILE__); \
                RESETCOLOR(); printf("Info:"#X"\n"); \
              }
                //getchar();



#define ERRX(X) {PT(X); \
                 printf("\tThis error causing program exit.\n"); \
                 exit(-1); \
                }

#define ERR(X) PT(X)

#else
#define PT(X)
#define ERRX(X)
#define ERR(X)
#endif

#endif

阅读(1927) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~