From b6a543bbc1d8077f3184837f255d433f02eab309 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 22 Apr 2005 14:29:25 +0000 Subject: [PATCH] Cleaned up files for linux Disabled SH_CCC_Makegate call for linux builds --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%4035 --- sourcehook/sh_memfuncinfo.h | 3 ++- sourcehook/sh_memory.h | 3 ++- sourcehook/sourcehook.cpp | 6 +++--- sourcehook/sourcehook.h | 4 ++-- sourcehook/sourcehook_impl.h | 3 ++- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sourcehook/sh_memfuncinfo.h b/sourcehook/sh_memfuncinfo.h index f6f9185..813d030 100644 --- a/sourcehook/sh_memfuncinfo.h +++ b/sourcehook/sh_memfuncinfo.h @@ -261,4 +261,5 @@ namespace SourceHook } -#endif \ No newline at end of file +#endif + diff --git a/sourcehook/sh_memory.h b/sourcehook/sh_memory.h index c32874e..41659a2 100644 --- a/sourcehook/sh_memory.h +++ b/sourcehook/sh_memory.h @@ -68,4 +68,5 @@ namespace SourceHook } -#endif \ No newline at end of file +#endif + diff --git a/sourcehook/sourcehook.cpp b/sourcehook/sourcehook.cpp index 7383b52..621d31f 100644 --- a/sourcehook/sourcehook.cpp +++ b/sourcehook/sourcehook.cpp @@ -20,7 +20,7 @@ # include #elif SH_SYS == SH_SYS_LINUX # include -# include +# include # include # ifndef PAGESIZE # define PAGESIZE 4096 @@ -459,7 +459,7 @@ namespace SourceHook void *callgate = NULL; #if SH_RUNTIME_CODEGEN == 1 unsigned char *cggen = new unsigned char[SH_CCC_CODESIZE]; - SH_CCC_MakeGate(cc.iface, cc.ptr, cggen, orig_entry); + //SH_CCC_MakeGate(cc.iface, cc.ptr, cggen, orig_entry); callgate = (void*)cggen; SetMemAccess(callgate, SH_CCC_CODESIZE, SH_MEM_READ | SH_MEM_WRITE | SH_MEM_EXEC); #else @@ -581,4 +581,4 @@ namespace SourceHook { return m_IfacePtr; } -} \ No newline at end of file +} diff --git a/sourcehook/sourcehook.h b/sourcehook/sourcehook.h index 4c25198..b3953da 100644 --- a/sourcehook/sourcehook.h +++ b/sourcehook/sourcehook.h @@ -24,16 +24,16 @@ #define SH_GLOB_PLUGPTR g_PLID #endif -#define SH_ASSERT(x) if (!(x)) __asm { int 3 } - // System #define SH_SYS_WIN32 1 #define SH_SYS_LINUX 2 #ifdef _WIN32 # define SH_SYS SH_SYS_WIN32 +# define SH_ASSERT(x) if (!(x)) __asm { int 3 } #elif defined __linux__ # define SH_SYS SH_SYS_LINUX +# define SH_ASSERT(x) if (!(x)) asm("int $3"); #else # error Unsupported system #endif diff --git a/sourcehook/sourcehook_impl.h b/sourcehook/sourcehook_impl.h index 3d35d25..c90d2dc 100644 --- a/sourcehook/sourcehook_impl.h +++ b/sourcehook/sourcehook_impl.h @@ -165,4 +165,5 @@ namespace SourceHook }; } -#endif \ No newline at end of file +#endif +