迁移对象
从Linux迁移到windows
C/C++ code:
typedef struct q931_h {
unsigned char raw[0];
u_int8_t pd; /* Protocol Discriminator */
#if __BYTE_ORDER == __BIG_ENDIAN
u_int8_t x0:4;
u_int8_t crlen:4;
#else
u_int8_t crlen:4;
u_int8_t x0:4;
#endif
u_int8_t contents[0];
u_int8_t crv[3];
} __attribute__ ((packed)) q931_h;
编译器
vs2008
错误
定义错误如下
error C2229: illegal zero-sized array
error C2143:syntax error : missing ')' before '('
error C2091: function returns function
error C2059: syntax error : ')'
使用该结构时的错误如下
error C2143: syntax error : missing ')' before '*'
error C2081: 'q931_h' : name in formal parameter list illegal
error C2143: syntax error : missing '{' before '*'
error C2059: syntax error : 'type'
error C2059: syntax error : ')'
unsigned char raw[0];这个定义在LINUX下能编译通过么?
你可以看看错误提示,说的比较清楚。
可以编译通过的,应该是符合Linux下C编程语法的