summaryrefslogtreecommitdiff
path: root/salhelper
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-10-07 07:52:26 +0300
committerTor Lillqvist <tml@iki.fi>2012-10-07 07:59:15 +0300
commit97593ae24a98daca89fad176dc2492e582b3a821 (patch)
treef52189545a5c5ffbc7cece7bca595b2cd18c9cc0 /salhelper
parent1691752dd29d661552700d9bcac5d3a3953fb91a (diff)
Handle lack of module loading/unloading API when DISABLE_DYNLOADING
There are basicically two classes of cases: 1) Where the code is for obscure historical reasons or what I see as misguided "optimization" split into a more libraries than necessary, and these then are loaded at run-time. Instead, just use direct linking. 2) Where dynamic loading is part of the functionality offered to some upper (scripting etc) layer, or where some system-specific non-LO library is loaded dynamically, as it is not necessarily present on end-user machines. Can't have such in the DISABLE_DYNLOADING case. Change-Id: I9eceac5fb635245def2f4f3320821447bb7cd8c0
Diffstat (limited to 'salhelper')
-rw-r--r--salhelper/source/dynload.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/salhelper/source/dynload.cxx b/salhelper/source/dynload.cxx
index 2e392af66ac1..f69ace831168 100644
--- a/salhelper/source/dynload.cxx
+++ b/salhelper/source/dynload.cxx
@@ -43,6 +43,13 @@ ORealDynamicLoader* ORealDynamicLoader::newInstance(ORealDynamicLoader ** ppSetT
const rtl::OUString& moduleName,
const rtl::OUString& initFunction)
{
+#ifdef DISABLE_DYNLOADING
+ (void) ppSetToZeroInDestructor;
+ (void) moduleName;
+ (void) initFunction;
+
+ return NULL;
+#else
ApiInitFunction initFunc;
oslModule pModule = osl_loadModule(moduleName.pData, SAL_LOADMODULE_DEFAULT);
@@ -64,6 +71,7 @@ ORealDynamicLoader* ORealDynamicLoader::newInstance(ORealDynamicLoader ** ppSetT
initFunction,
initFunc(),
pModule));
+#endif
}
ORealDynamicLoader::~ORealDynamicLoader()
@@ -74,7 +82,9 @@ ORealDynamicLoader::~ORealDynamicLoader()
if (m_pModule)
{
+#ifndef DISABLE_DYNLOADING
osl_unloadModule(m_pModule);
+#endif
m_pModule = NULL;
}
}