谁帮我编译一下这个文件?vc编译出错,而cygwin下没问题
typedef unsigned charu8;
typedef unsigned shortu16;
typedef unsigned intu32;
#define MC_PCC_FILL_STRUCT3 u8:0; u8:8; u8:8; u8:8; u8:0;
typedef struct __alg { char c; MC_PCC_FILL_STRUCT3 void * p; } __alg_t;
#define MC_PPC_DISTANCE_OF(S,F) (unsigned) (&(((S *) 0)-> F))
#define ALIGNMENT (MC_PPC_DISTANCE_OF(__alg_t, p) - 1)
#define ALIGN(P) ( (u32) ((char *)(P) + ALIGNMENT) & ~ALIGNMENT)
#define STACK0_SIZE 1000
#define INTERRUPT_STACK_SIZE 5000
u8 InterruptStack[ALIGN( INTERRUPT_STACK_SIZE )];
u8 stack_task0[ALIGN (STACK0_SIZE) ];
int main()
{
return 1;
}
[解决办法]
我试了 结果和你的一样
[解决办法]
cannot allocate an array of constant size 0
因为计算结果为0;而VC不支持0 大小的数组
[解决办法]
u8 InterruptStack[ALIGN( INTERRUPT_STACK_SIZE )];
数组大小为0