diff --git a/sourcehook/generate/sourcehook.h b/sourcehook/generate/sourcehook.h index 8b929ce..f188435 100644 --- a/sourcehook/generate/sourcehook.h +++ b/sourcehook/generate/sourcehook.h @@ -25,10 +25,13 @@ #define SH_IFACE_VERSION 4 #define SH_IMPL_VERSION 3 +// The value of SH_GLOB_SHPTR has to be a pointer to SourceHook::ISourceHook +// It's used in various macros #ifndef SH_GLOB_SHPTR #define SH_GLOB_SHPTR g_SHPtr #endif +// Used to identify the current plugin #ifndef SH_GLOB_PLUGPTR #define SH_GLOB_PLUGPTR g_PLID #endif @@ -447,7 +450,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C if (SH_GLOB_SHPTR->GetIfaceVersion() != SH_IFACE_VERSION) \ return 1; \ \ - if (action == ::SourceHook::HA_GetInfo) \ + if (action == HA_GetInfo) \ { \ param->SetInfo(ms_MFI.vtbloffs, ms_MFI.vtblindex, ms_Proto); \ \ @@ -457,12 +460,12 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C reinterpret_cast(reinterpret_cast(&ms_Inst) + mfi.vtbloffs)[mfi.vtblindex]); \ return 0; \ } \ - else if (action == ::SourceHook::HA_Register) \ + else if (action == HA_Register) \ { \ ms_HI = param; \ return 0; \ } \ - else if (action == ::SourceHook::HA_Unregister) \ + else if (action == HA_Unregister) \ { \ ms_HI = NULL; \ return 0; \ @@ -1767,8 +1770,6 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C #if SH_COMP == SH_COMP_MSVC -// :TODO: TEST THIS ON MSVC - # define SH_MAKE_EXECUTABLECLASS_OB(call, prms) \ { \ using namespace ::SourceHook; \ diff --git a/sourcehook/generate/sourcehook.hxx b/sourcehook/generate/sourcehook.hxx index 1a8e89f..0557d29 100755 --- a/sourcehook/generate/sourcehook.hxx +++ b/sourcehook/generate/sourcehook.hxx @@ -25,10 +25,13 @@ #define SH_IFACE_VERSION 4 #define SH_IMPL_VERSION 3 +// The value of SH_GLOB_SHPTR has to be a pointer to SourceHook::ISourceHook +// It's used in various macros #ifndef SH_GLOB_SHPTR #define SH_GLOB_SHPTR g_SHPtr #endif +// Used to identify the current plugin #ifndef SH_GLOB_PLUGPTR #define SH_GLOB_PLUGPTR g_PLID #endif @@ -447,7 +450,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C if (SH_GLOB_SHPTR->GetIfaceVersion() != SH_IFACE_VERSION) \ return 1; \ \ - if (action == ::SourceHook::HA_GetInfo) \ + if (action == HA_GetInfo) \ { \ param->SetInfo(ms_MFI.vtbloffs, ms_MFI.vtblindex, ms_Proto); \ \ @@ -457,12 +460,12 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C reinterpret_cast(reinterpret_cast(&ms_Inst) + mfi.vtbloffs)[mfi.vtblindex]); \ return 0; \ } \ - else if (action == ::SourceHook::HA_Register) \ + else if (action == HA_Register) \ { \ ms_HI = param; \ return 0; \ } \ - else if (action == ::SourceHook::HA_Unregister) \ + else if (action == HA_Unregister) \ { \ ms_HI = NULL; \ return 0; \ @@ -749,8 +752,6 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C #if SH_COMP == SH_COMP_MSVC -// :TODO: TEST THIS ON MSVC - # define SH_MAKE_EXECUTABLECLASS_OB(call, prms) \ { \ using namespace ::SourceHook; \ diff --git a/sourcehook/sourcehook.h b/sourcehook/sourcehook.h index 8b929ce..f188435 100644 --- a/sourcehook/sourcehook.h +++ b/sourcehook/sourcehook.h @@ -25,10 +25,13 @@ #define SH_IFACE_VERSION 4 #define SH_IMPL_VERSION 3 +// The value of SH_GLOB_SHPTR has to be a pointer to SourceHook::ISourceHook +// It's used in various macros #ifndef SH_GLOB_SHPTR #define SH_GLOB_SHPTR g_SHPtr #endif +// Used to identify the current plugin #ifndef SH_GLOB_PLUGPTR #define SH_GLOB_PLUGPTR g_PLID #endif @@ -447,7 +450,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C if (SH_GLOB_SHPTR->GetIfaceVersion() != SH_IFACE_VERSION) \ return 1; \ \ - if (action == ::SourceHook::HA_GetInfo) \ + if (action == HA_GetInfo) \ { \ param->SetInfo(ms_MFI.vtbloffs, ms_MFI.vtblindex, ms_Proto); \ \ @@ -457,12 +460,12 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C reinterpret_cast(reinterpret_cast(&ms_Inst) + mfi.vtbloffs)[mfi.vtblindex]); \ return 0; \ } \ - else if (action == ::SourceHook::HA_Register) \ + else if (action == HA_Register) \ { \ ms_HI = param; \ return 0; \ } \ - else if (action == ::SourceHook::HA_Unregister) \ + else if (action == HA_Unregister) \ { \ ms_HI = NULL; \ return 0; \ @@ -1767,8 +1770,6 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C #if SH_COMP == SH_COMP_MSVC -// :TODO: TEST THIS ON MSVC - # define SH_MAKE_EXECUTABLECLASS_OB(call, prms) \ { \ using namespace ::SourceHook; \ diff --git a/sourcehook/sourcehook_impl.h b/sourcehook/sourcehook_impl.h index 92956de..fbd71fb 100644 --- a/sourcehook/sourcehook_impl.h +++ b/sourcehook/sourcehook_impl.h @@ -17,10 +17,6 @@ #include "sh_tinyhash.h" #include "sh_stack.h" -// Set this to 1 to enable runtime code generation (faster) -// (unused at the moment, but may come back, so I'm leaving it in here!) -#define SH_RUNTIME_CODEGEN 1 - namespace SourceHook { /** diff --git a/sourcehook/test/testlist.cpp b/sourcehook/test/testlist.cpp index de8462f..0377bb4 100644 --- a/sourcehook/test/testlist.cpp +++ b/sourcehook/test/testlist.cpp @@ -8,7 +8,6 @@ // Tests sh_list, sh_tinyhash, sh_vector // :TODO: vector test -// :TODO: stack test namespace {