From ebec84c55ddde126483f261ad87c018185dbbcc5 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Tue, 27 Sep 2011 01:38:13 +0000 Subject: [PATCH] Fix q3vm execution on x86/x86_64 MacOSX --- code/qcommon/vm_x86.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/code/qcommon/vm_x86.c b/code/qcommon/vm_x86.c index 1baf8223..d19763e6 100644 --- a/code/qcommon/vm_x86.c +++ b/code/qcommon/vm_x86.c @@ -24,21 +24,22 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "vm_local.h" #ifdef _WIN32 -#include -#endif + #include +#else + #ifdef __FreeBSD__ + #include + #endif -#ifdef __FreeBSD__ -#include -#endif + #include // for PROT_ stuff -#ifndef _WIN32 -#include // for PROT_ stuff -#endif - -/* need this on NX enabled systems (i386 with PAE kernel or - * noexec32=on x86_64) */ -#if defined(__linux__) || defined(__FreeBSD__) -#define VM_X86_MMAP + /* need this on NX enabled systems (i386 with PAE kernel or + * noexec32=on x86_64) */ + #define VM_X86_MMAP + + // workaround for systems that use the old MAP_ANON macro + #ifndef MAP_ANONYMOUS + #define MAP_ANONYMOUS MAP_ANON + #endif #endif static void VM_Destroy_Compiled(vm_t* self);