Remove temporary compatibility hook helpers

This commit is contained in:
baldurk
2018-07-04 16:01:08 +01:00
parent a504389bd1
commit 9999ec25b8
2 changed files with 0 additions and 39 deletions
-32
View File
@@ -52,35 +52,3 @@ void LibraryHooks::OptionsUpdated()
for(LibraryHook *lib : LibList())
lib->OptionsUpdated();
}
////////////////////////////////////////////////////////////////////////
// Very temporary compatibility layer with previous function interface.
//
// PosixHookFunction just calls LibraryHooks::RegisterFunctionHook and
// stores the resulting pointer in a map to look up later in
// PosixGetFunction
////////////////////////////////////////////////////////////////////////
static std::map<std::string, void **> origLookup;
void PosixHookFunction(const char *name, void *hook)
{
void **orig = origLookup[name];
if(orig == NULL)
{
orig = origLookup[name] = new void *;
*orig = NULL;
}
LibraryHooks::RegisterFunctionHook("", FunctionHook(name, orig, hook));
}
void *PosixGetFunction(void *handle, const char *name)
{
void **orig = origLookup[name];
if(orig && *orig)
return *orig;
ScopedSuppressHooking suppress;
return Process::GetFunctionAddress(handle, name);
}
-7
View File
@@ -212,10 +212,3 @@ struct ScopedSuppressHooking
ScopedSuppressHooking();
~ScopedSuppressHooking();
};
////////////////////////////////////////////////////////////////////////
// Very temporary compatibility layer with previous function interface.
////////////////////////////////////////////////////////////////////////
void PosixHookFunction(const char *name, void *hook);
void *PosixGetFunction(void *handle, const char *name);