Fixed various areas where code was being compiled for Linux only, but should actually be used on OS X too (bug 4392, r=dvander).

This commit is contained in:
Scott Ehlert
2010-05-29 18:11:47 -04:00
parent 9a35085ac3
commit e518605d69
12 changed files with 17 additions and 20 deletions
+2 -2
View File
@@ -32,7 +32,7 @@
#ifndef _INCLUDE_SOURCEMOD_DETOURHELPERS_H_
#define _INCLUDE_SOURCEMOD_DETOURHELPERS_H_
#if defined PLATFORM_LINUX || defined PLATFORM_APPLE
#if defined PLATFORM_POSIX
#include <sys/mman.h>
#define PAGE_SIZE 4096
#define ALIGN(ar) ((long)ar & ~(PAGE_SIZE-1))
@@ -52,7 +52,7 @@ struct patch_t
inline void ProtectMemory(void *addr, int length, int prot)
{
#if defined PLATFORM_LINUX
#if defined PLATFORM_POSIX
void *addr2 = (void *)ALIGN(addr);
mprotect(addr2, sysconf(_SC_PAGESIZE), prot);
#elif defined PLATFORM_WINDOWS