__WORDSIZE is not available on non-GNU systems (Dominic Fandrey)

This commit is contained in:
Ludwig Nussel 2010-01-16 10:55:51 +00:00
parent 9018fedd16
commit 4876413217

View file

@ -516,18 +516,20 @@ nextInstruction2:
//VM_LogSyscalls( (int *)&image[ programStack + 4 ] ); //VM_LogSyscalls( (int *)&image[ programStack + 4 ] );
{ {
intptr_t* argptr = (intptr_t *)&image[ programStack + 4 ]; // the vm has ints on the stack, we expect
#if __WORDSIZE == 64 // pointers so we might have to convert it
// the vm has ints on the stack, we expect if (sizeof(intptr_t) != sizeof(int)) {
// longs so we have to convert it intptr_t argarr[16];
intptr_t argarr[16]; int *imagePtr = (int *)&image[programStack];
int i; int i;
for (i = 0; i < 16; ++i) { for (i = 0; i < 16; ++i) {
argarr[i] = *(int*)&image[ programStack + 4 + 4*i ]; argarr[i] = *(++imagePtr);
}
r = vm->systemCall( argarr );
} else {
intptr_t* argptr = (intptr_t *)&image[ programStack + 4 ];
r = vm->systemCall( argptr );
} }
argptr = argarr;
#endif
r = vm->systemCall( argptr );
} }
#ifdef DEBUG_VM #ifdef DEBUG_VM