diff --git a/src/precomp/FunctionResolver.h b/src/precomp/FunctionResolver.h index 9dbb964..43a6594 100644 --- a/src/precomp/FunctionResolver.h +++ b/src/precomp/FunctionResolver.h @@ -205,10 +205,16 @@ struct FunctionResolver { #ifdef OPEN_SHC_DLL template struct FunctionPtrUnifier { - inline static const FuncPtrType get() { return reinterpret_cast(&GameCallerFunction::call); } + inline static const FuncPtrType get() + { + return reinterpret_cast(&GameCaller::Function::call); + } }; template struct FunctionPtrUnifier { - inline static const FuncPtrType get() { return reinterpret_cast(&WrapperFunction::call); } + inline static const FuncPtrType get() + { + return reinterpret_cast(&Wrapper::Function::call); + } }; typedef FunctionPtrUnifier UnifiedFunctionPtrForWrapper; @@ -277,20 +283,20 @@ struct FunctionResolver { #define MACRO_CALL_WRAPPER(N) \ MACRO_FUNC_TEMPLATE_HEADER(, Ret, N, ) struct Wrapper { \ private: \ - template struct CallHelper : public UnifiedFunctionPtrForWrapper { \ + template struct CallHelper { \ __declspec(noinline) static R __cdecl call(MACRO_PARAMETER_TYPE_PARAMETER_LIST(N)) \ { \ MACRO_WRAPPER_BODY_PRECALL(N) \ - Ret ret = get()(MACRO_PARAMETER_LIST(N)); \ + Ret ret = UnifiedFunctionPtrForWrapper::get()(MACRO_PARAMETER_LIST(N)); \ MACRO_WRAPPER_BODY_POSTCALL(N) \ return ret; \ } \ }; \ - template struct CallHelper : public UnifiedFunctionPtrForWrapper { \ + template struct CallHelper { \ __declspec(noinline) static void __cdecl call(MACRO_PARAMETER_TYPE_PARAMETER_LIST(N)) \ { \ MACRO_WRAPPER_BODY_PRECALL(N) \ - get()(MACRO_PARAMETER_LIST(N)); \ + UnifiedFunctionPtrForWrapper::get()(MACRO_PARAMETER_LIST(N)); \ MACRO_WRAPPER_BODY_POSTCALL_VOID(N) \ } \ }; \ @@ -300,20 +306,20 @@ struct FunctionResolver { }; \ MACRO_FUNC_TEMPLATE_HEADER(, Ret, N, ) struct Wrapper { \ private: \ - template struct CallHelper : public UnifiedFunctionPtrForWrapper { \ + template struct CallHelper { \ __declspec(noinline) static R __stdcall call(MACRO_PARAMETER_TYPE_PARAMETER_LIST(N)) \ { \ MACRO_WRAPPER_BODY_PRECALL(N) \ - Ret ret = get()(MACRO_PARAMETER_LIST(N)); \ + Ret ret = UnifiedFunctionPtrForWrapper::get()(MACRO_PARAMETER_LIST(N)); \ MACRO_WRAPPER_BODY_POSTCALL(N) \ return ret; \ } \ }; \ - template struct CallHelper : public UnifiedFunctionPtrForWrapper { \ + template struct CallHelper { \ __declspec(noinline) static void __stdcall call(MACRO_PARAMETER_TYPE_PARAMETER_LIST(N)) \ { \ MACRO_WRAPPER_BODY_PRECALL(N) \ - get()(MACRO_PARAMETER_LIST(N)); \ + UnifiedFunctionPtrForWrapper::get()(MACRO_PARAMETER_LIST(N)); \ MACRO_WRAPPER_BODY_POSTCALL_VOID(N) \ } \ }; \ @@ -323,20 +329,20 @@ struct FunctionResolver { }; \ MACRO_CLASS_FUNC_TEMPLATE_HEADER(, Ret, Class, N, ) struct Wrapper { \ private: \ - template struct CallHelper : public UnifiedFunctionPtrForWrapper { \ + template struct CallHelper { \ __declspec(noinline) R call(MACRO_PARAMETER_TYPE_PARAMETER_LIST(N)) \ { \ MACRO_WRAPPER_BODY_PRECALL_THISCALL(N) \ - Ret ret = (((Class*)(this))->*get())(MACRO_PARAMETER_LIST(N)); \ + Ret ret = (((Class*)(this))->*UnifiedFunctionPtrForWrapper::get())(MACRO_PARAMETER_LIST(N)); \ MACRO_WRAPPER_BODY_POSTCALL(N) \ return ret; \ } \ }; \ - template struct CallHelper : public UnifiedFunctionPtrForWrapper { \ + template struct CallHelper { \ __declspec(noinline) void call(MACRO_PARAMETER_TYPE_PARAMETER_LIST(N)) \ { \ MACRO_WRAPPER_BODY_PRECALL_THISCALL(N) \ - (((Class*)(this))->*get())(MACRO_PARAMETER_LIST(N)); \ + (((Class*)(this))->*UnifiedFunctionPtrForWrapper::get())(MACRO_PARAMETER_LIST(N)); \ MACRO_WRAPPER_BODY_POSTCALL_VOID(N) \ } \ }; \ @@ -355,8 +361,6 @@ struct FunctionResolver { #undef MACRO_MACRO_STREAM_PRINT_PARAMETER_LIST #undef MACRO_STREAM_PRINT_PARAMETER - typedef typename Wrapper::Function WrapperFunction; - template struct GameCaller; #define MACRO_GAME_CALLER(N) \ @@ -419,8 +423,6 @@ struct FunctionResolver { MACRO_INDEX_ITERATE_DEPTH_1(MACRO_NUMBER_OF_FUNCTIONS_TO_GENERATE, MACRO_GAME_CALLER, M_SPACE) #undef MACRO_GAME_CALLER - typedef typename GameCaller::Function GameCallerFunction; - typedef FunctionPtrUnifier UnifiedFunctionPtr; #endif