Exemple #1
0
dword Com_FunctionFromName( void *hInstance, const char *pName )
{
	dword function = (dword)GetProcAddress( hInstance, pName );
	if(!function)
	{
#ifdef __ANDROID__
		// Shitty Android dlsym don't resolve weak symbols
		function = (dword)dlsym_weak( hInstance, pName );
		if(!function)
#endif
			MsgDev(D_ERROR, "FunctionFromName: Can't get symbol %s: %s", pName, dlerror());
	}
	return function;
}
Exemple #2
0
void *Com_FunctionFromName( void *hInstance, const char *pName )
{
	void *function;
#ifdef DLL_LOADER
	void *wm;
	if( host.enabledll && (wm = Loader_GetDllHandle( hInstance )) )
		return Loader_GetProcAddress(hInstance, pName);
	else
#endif
	function = dlsym( hInstance, pName );	
	if(!function)
	{
#ifdef __ANDROID__
		// Shitty Android dlsym don't resolve weak symbols
		function = dlsym_weak( hInstance, pName );
		if(!function)
#endif
#ifndef _WIN32
			MsgDev(D_ERROR, "FunctionFromName: Can't get symbol %s: %s\n", pName, dlerror());
#endif
	}
	return function;
}