变量定义中间可以使用宏判断吗
Button but_main[11]={
{20,75,370,390,"AUTOUPDATE",1,BUT_LINE_COLOR,0,1,DialogEvent,but_main,dlog,NULL},//0{410,75,370,57,NULL,0,BUT_LINE_COLOR,1,1,NULL,NULL,NULL,NULL},// 1{410,408,370,57,NULL,1,BUT_LINE_COLOR,2,1,NULL,NULL,NULL,NULL},// 2
{410,144,370,57,"VIEWVERSION",1,BUT_LINE_COLOR,3,1,DialogEvent,but_main+3,dlog+1,NULL},// 3
{410,209,370,57,"UPDATELOGO",1,BUT_LINE_COLOR,4,1,DialogEvent,but_main+4,dlog+2,NULL},// 4
#ifdef PRB_UPDATE_MODULE==1
{410,144,370,57,"PROTOCOLBOXUPDATE",1,BUT_LINE_COLOR,5,1,DialogEvent,but_main+5,dlog+5,NULL},//5
#else
{410,144,370,57,"RESERVED",0x80,BUT_LINE_COLOR,5,1,NULL,NULL,NULL,NULL},//5
#endif
{410,209,370,57,"RESERVED",0x80,6,1,NULL,NULL,NULL,NULL},//6{410,274,370,57,"RESERVED",0x80,7,1,NULL,NULL,NULL,NULL},//7
};
我使用了宏判断,编译不会报错,但是无论PRB_UPDATE_MODULE为0还是1都是执行上面一句,#else的不会执行,请问给位大虾,是不是定义变量的时候不能用宏判断呢???
[解决办法]
#ifdef PRB_UPDATE_MODULE==1
#if PRB_UPDATE_MODULE==1
#ifdef PRB_UPDATE_MODULE