openbsd-ports/games/openarena/patches/patch-code_qcommon_vm_interpreted_c
kili d538a695c6 Unbreak for amd64. Initial fix (for amd64 only) from Jordi Beltran
Creix (jbcreix.mail at gmail.com). Generalized for all LP64
architectures by me. At least in theory. Some tests on sparc64
didn't go very well, and nobody tested on other archs, so just keep
ONLY_FOR_ARCHS (with amd64 added) for now.

Antti Harri (MAINTAINER) agrees.
2009-02-03 19:48:41 +00:00

24 lines
812 B
Plaintext

$OpenBSD: patch-code_qcommon_vm_interpreted_c,v 1.1 2009/02/03 19:48:42 kili Exp $
--- code/qcommon/vm_interpreted.c.orig Sat Aug 9 18:28:20 2008
+++ code/qcommon/vm_interpreted.c Sat Jan 10 21:23:02 2009
@@ -532,8 +532,8 @@ nextInstruction2:
//VM_LogSyscalls( (int *)&image[ programStack + 4 ] );
{
- intptr_t* argptr = (intptr_t *)&image[ programStack + 4 ];
- #if __WORDSIZE == 64
+ intptr_t* argptr;
+ #if LONG_BIT == 64
// the vm has ints on the stack, we expect
// longs so we have to convert it
intptr_t argarr[16];
@@ -542,6 +542,8 @@ nextInstruction2:
argarr[i] = *(int*)&image[ programStack + 4 + 4*i ];
}
argptr = argarr;
+ #else
+ argptr = (intptr_t *)&image[ programStack + 4 ];
#endif
r = vm->systemCall( argptr );
}