Preserve original function names

This commit is contained in:
Nekotekina 2017-04-28 19:03:24 +03:00
parent b349100d9d
commit eba44261c7

View File

@ -4,7 +4,17 @@
#include "PPUCallback.h"
#include "ErrorCodes.h"
#include <map>
// Helper function
constexpr const char* ppu_select_name(const char* name, u32 id)
{
return name;
}
// Helper function
constexpr const char* ppu_select_name(const char* name, const char* orig_name)
{
return orig_name;
}
// Generate FNID or VNID for given name
extern u32 ppu_generate_id(const char* name);
@ -226,11 +236,11 @@ inline RT ppu_execute_function_or_callback(const char* name, ppu_thread& ppu, Ar
#define CALL_FUNC(ppu, func, ...) ppu_execute_function_or_callback<decltype(&func), &func>(#func, ppu, __VA_ARGS__)
#define REG_FNID(module, nid, func) ppu_module_manager::register_static_function<decltype(&func), &func>(#module, #func, BIND_FUNC(func), ppu_generate_id(nid))
#define REG_FNID(module, nid, func) ppu_module_manager::register_static_function<decltype(&func), &func>(#module, ppu_select_name(#func, nid), BIND_FUNC(func), ppu_generate_id(nid))
#define REG_FUNC(module, func) REG_FNID(module, #func, func)
#define REG_VNID(module, nid, var) ppu_module_manager::register_static_variable<decltype(var), &var>(#module, #var, ppu_generate_id(nid))
#define REG_VNID(module, nid, var) ppu_module_manager::register_static_variable<decltype(var), &var>(#module, ppu_select_name(#var, nid), ppu_generate_id(nid))
#define REG_VAR(module, var) REG_VNID(module, #var, var)