Avoid all calls to libdl (or equivalent) if NO_DYNAMIC_VP is defined

The same ifdefs are already used in the corresponding constructors,
so this just avoids a runtime/link time library dependency which
is practically unused in this build setup.
This commit is contained in:
Martin Storsjö 2013-12-14 13:15:58 +02:00
parent a8d125f52e
commit aa78f205d6
2 changed files with 4 additions and 0 deletions

View File

@ -141,6 +141,7 @@ CWelsLib::~CWelsLib() {
void* CWelsLib::QueryFunction (const str_t* pName) {
void* pFunc = NULL;
#ifndef NO_DYNAMIC_VP
if (m_pVpLib) {
#if defined(WIN32)
HMODULE shModule = (HMODULE)m_pVpLib;
@ -157,6 +158,7 @@ void* CWelsLib::QueryFunction (const str_t* pName) {
printf ("dlsym %s iRet=%p, err=%s\n", shModule, pFunc, dlerror());
#endif
}
#endif
return pFunc;
}

View File

@ -242,6 +242,7 @@ welsCodecTrace::welsCodecTrace() {
}
welsCodecTrace::~welsCodecTrace() {
#ifndef NO_DYNAMIC_VP
#if defined WIN32
if (m_hTraceHandle) {
::FreeLibrary ((HMODULE)m_hTraceHandle);
@ -254,6 +255,7 @@ welsCodecTrace::~welsCodecTrace() {
if (m_hTraceHandle) {
::dlclose (m_hTraceHandle);
}
#endif
#endif
m_hTraceHandle = NULL;