pushed old commit

This commit is contained in:
jeefo 2015-12-17 09:57:41 +03:00
commit 3113935751
3 changed files with 10 additions and 9 deletions

View file

@ -140,15 +140,16 @@ public:
return m_ptr;
}
void *GetFunctionAddr (const char *functionName)
template <typename R> R GetFuncAddr (const char *function)
{
if (!IsLoaded ())
return NULL;
#ifdef PLATFORM_WIN32
return GetProcAddress ((HMODULE) m_ptr, functionName);
return reinterpret_cast <R> (GetProcAddress (static_cast <HMODULE> (m_ptr), function));
#else
return dlsym (m_ptr, functionName);
return reinterpret_cast <R> (dlsym (m_ptr, function));
#endif
}