ref: aa78f205d678a6d92e33545a17608d270f524eda
parent: a8d125f52e47354a42568fc4c3cb2453010ea903
author: Martin Storsjö <martin@martin.st>
date: Sat Dec 14 08:15:58 EST 2013
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.
--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -141,6 +141,7 @@
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 @@
printf ("dlsym %s iRet=%p, err=%s\n", shModule, pFunc, dlerror());
#endif
}
+#endif
return pFunc;
}
--- a/codec/encoder/plus/src/welsCodecTrace.cpp
+++ b/codec/encoder/plus/src/welsCodecTrace.cpp
@@ -242,6 +242,7 @@
}
welsCodecTrace::~welsCodecTrace() {
+#ifndef NO_DYNAMIC_VP
#if defined WIN32
if (m_hTraceHandle) {
::FreeLibrary ((HMODULE)m_hTraceHandle);
@@ -254,6 +255,7 @@
if (m_hTraceHandle) {
::dlclose (m_hTraceHandle);
}
+#endif
#endif
m_hTraceHandle = NULL;