Compilation fix

This commit is contained in:
Nekotekina 2015-02-20 17:42:41 +03:00
parent 8cd00287cd
commit 8d13aa3f2e
3 changed files with 22 additions and 22 deletions

View File

@ -352,10 +352,10 @@ namespace psv_func_detail
return put_func_args<g1, f, v>(context, args...) || (t == ARG_STACK);
}
template<void(*func)(), typename RT, typename... T>
template<void(func)(), typename RT, typename... T>
struct func_binder;
template<void(*func)(), typename... T>
template<void(func)(), typename... T>
struct func_binder<func, void, T...>
{
typedef void(*func_t)(T...);
@ -366,7 +366,7 @@ namespace psv_func_detail
}
};
template<void(*func)(), typename... T>
template<void(func)(), typename... T>
struct func_binder<func, void, ARMv7Context&, T...>
{
typedef void(*func_t)(ARMv7Context&, T...);
@ -377,7 +377,7 @@ namespace psv_func_detail
}
};
template<void(*func)(), typename RT, typename... T>
template<void(func)(), typename RT, typename... T>
struct func_binder
{
typedef RT(*func_t)(T...);
@ -388,7 +388,7 @@ namespace psv_func_detail
}
};
template<void(*func)(), typename RT, typename... T>
template<void(func)(), typename RT, typename... T>
struct func_binder<func, RT, ARMv7Context&, T...>
{
typedef RT(*func_t)(ARMv7Context&, T...);
@ -448,7 +448,7 @@ enum psv_special_function_index : u16
// Do not call directly
u32 add_psv_func(psv_func data);
// Do not call directly
template<void(*func)(), typename RT, typename... T> void reg_psv_func(u32 nid, psv_log_base* module, const char* name, RT(*_func)(T...))
template<void(func)(), typename RT, typename... T> void reg_psv_func(u32 nid, psv_log_base* module, const char* name, RT(*_func)(T...))
{
psv_func f;
f.nid = nid;
@ -459,7 +459,7 @@ template<void(*func)(), typename RT, typename... T> void reg_psv_func(u32 nid, p
add_psv_func(f);
}
typedef void(*func_ptr)();
typedef void(func_ptr)();
// Find registered HLE function by NID
psv_func* get_psv_func_by_nid(u32 nid, u32* out_index = nullptr);

View File

@ -111,9 +111,9 @@ public:
bool RemoveId(u32 id);
template<void(*func)(), typename T> __forceinline u32 AddFunc(const u32 nid, T _func);
template<void(*func)(), typename T> __forceinline u32 AddFunc(const char* name, T _func);
template<void(*func)(), typename T> __forceinline u32 AddFuncSub(const char group[8], const u64 ops[], const char* name, T _func);
template<void(func)(), typename T> __forceinline u32 AddFunc(const u32 nid, T _func);
template<void(func)(), typename T> __forceinline u32 AddFunc(const char* name, T _func);
template<void(func)(), typename T> __forceinline u32 AddFuncSub(const char group[8], const u64 ops[], const char* name, T _func);
};
u32 add_ps3_func(ModuleFunc func);
@ -123,19 +123,19 @@ void execute_ps3_func_by_index(PPUThread& CPU, u32 id);
void clear_ps3_functions();
u32 get_function_id(const char* name);
template<void(*func)(), typename T>
template<void(func)(), typename T>
__forceinline u32 Module::AddFunc(const u32 nid, T _func)
{
return add_ps3_func(ModuleFunc(nid, this, ppu_func_detail::_bind_func<func>(_func)));
}
template<void(*func)(), typename T>
template<void(func)(), typename T>
__forceinline u32 Module::AddFunc(const char* name, T _func)
{
return AddFunc<func>(get_function_id(name), _func);
}
template<void(*func)(), typename T>
template<void(func)(), typename T>
__forceinline u32 Module::AddFuncSub(const char group[8], const u64 ops[], const char* name, T _func)
{
SFunc* sf = new SFunc;
@ -163,8 +163,8 @@ __forceinline u32 Module::AddFuncSub(const char group[8], const u64 ops[], const
#define REG_SUB(module, group, name, ...) \
static const u64 name ## _table[] = {__VA_ARGS__ , 0}; \
if (name ## _table[0]) module.AddFuncSub<(void(*)())name>(group, name ## _table, #name, name)
if (name ## _table[0]) module.AddFuncSub<(void())name>(group, name ## _table, #name, name)
#define REG_FUNC(module, name) module.AddFunc<(void(*)())name>(#name, name)
#define REG_FUNC(module, name) module.AddFunc<(void())name>(#name, name)
#define UNIMPLEMENTED_FUNC(module) module.Error("%s", __FUNCTION__)

View File

@ -156,10 +156,10 @@ namespace ppu_func_detail
static const bind_arg_type value = is_float ? ARG_FLOAT : (is_vector ? ARG_VECTOR : ARG_GENERAL);
};
template<void(*func)(), typename RT, typename... T>
template<void(func)(), typename RT, typename... T>
struct func_binder;
template<void(*func)(), typename... T>
template<void(func)(), typename... T>
struct func_binder<func, void, T...>
{
typedef void(*func_t)(T...);
@ -170,7 +170,7 @@ namespace ppu_func_detail
}
};
template<void(*func)(), typename... T>
template<void(func)(), typename... T>
struct func_binder<func, void, PPUThread&, T...>
{
typedef void(*func_t)(PPUThread&, T...);
@ -181,7 +181,7 @@ namespace ppu_func_detail
}
};
template<void(*func)(), typename RT, typename... T>
template<void(func)(), typename RT, typename... T>
struct func_binder
{
typedef RT(*func_t)(T...);
@ -192,7 +192,7 @@ namespace ppu_func_detail
}
};
template<void(*func)(), typename RT, typename... T>
template<void(func)(), typename RT, typename... T>
struct func_binder<func, RT, PPUThread&, T...>
{
typedef RT(*func_t)(PPUThread&, T...);
@ -205,11 +205,11 @@ namespace ppu_func_detail
using bound_func_t = void(*)(PPUThread&);
template<void(*func)(), typename RT, typename... T>
template<void(func)(), typename RT, typename... T>
bound_func_t _bind_func(RT(*_func)(T...))
{
return ppu_func_detail::func_binder<func, RT, T...>::do_call;
}
}
#define bind_func(func) (ppu_func_detail::_bind_func<(void(*)())func>(func))
#define bind_func(func) (ppu_func_detail::_bind_func<(void())func>(func))