summaryrefslogtreecommitdiff
path: root/sal/osl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-10-07 07:45:10 +0300
committerTor Lillqvist <tml@iki.fi>2012-10-07 07:59:14 +0300
commit1691752dd29d661552700d9bcac5d3a3953fb91a (patch)
tree9d00ce644407c938936fe34ed1c9946c08245f64 /sal/osl
parent68669491ade83c395144b66a4f65cd7720f76a55 (diff)
When DISABLE_DYNLOADING don't even provide any module loading/unloading API
Will then cause compilation errors where they are used, which will be noticed and taken care of. (The code chanaged to either use direct linking instead, when it makes sense, or to just bypass the functionality that requires dynamic loading.) Much better than waiting until run-time to notice where dynamic loading is attempted. Change-Id: Ib0cb5a2524b5c63f8e27670e7d72e37ce2a8e6e9
Diffstat (limited to 'sal/osl')
-rw-r--r--sal/osl/all/loadmodulerelative.cxx4
-rw-r--r--sal/osl/unx/module.cxx17
2 files changed, 13 insertions, 8 deletions
diff --git a/sal/osl/all/loadmodulerelative.cxx b/sal/osl/all/loadmodulerelative.cxx
index f3ea7bfe3509..6b7cf0e43b17 100644
--- a/sal/osl/all/loadmodulerelative.cxx
+++ b/sal/osl/all/loadmodulerelative.cxx
@@ -43,6 +43,8 @@
extern "C" {
+#ifndef DISABLE_DYNLOADING
+
oslModule SAL_CALL osl_loadModuleRelative(
oslGenericFunction const baseModule, rtl_uString * const relativePath,
sal_Int32 const mode)
@@ -67,6 +69,8 @@ oslModule SAL_CALL osl_loadModuleRelative(
return ::osl_loadModule(abs.pData, mode);
}
+#endif // !DISABLE_DYNLOADING
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/module.cxx b/sal/osl/unx/module.cxx
index 386aa0b1c2a9..ed2f675c6858 100644
--- a/sal/osl/unx/module.cxx
+++ b/sal/osl/unx/module.cxx
@@ -118,6 +118,9 @@ static sal_Bool getModulePathFromAddress(void * address, rtl_String ** path) {
return result;
}
+
+#ifndef DISABLE_DYNLOADING
+
/*****************************************************************************/
/* osl_loadModule */
/*****************************************************************************/
@@ -157,7 +160,6 @@ oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nR
"sal.osl", "only either LAZY or NOW");
if (pModuleName)
{
-#ifndef DISABLE_DYNLOADING
#ifdef ANDROID
(void) nRtldMode;
void *pLib = lo_dlopen(pModuleName);
@@ -173,11 +175,6 @@ oslModule SAL_CALL osl_loadModuleAscii(const sal_Char *pModuleName, sal_Int32 nR
<< dlerror());
#endif
return ((oslModule)(pLib));
-
-#else /* DISABLE_DYNLOADING */
- (void) nRtldMode;
- fprintf(stderr, "No DL Functions, osl_loadModuleAscii(%s) does nothing\n", pModuleName);
-#endif /* DISABLE_DYNLOADING */
}
return NULL;
}
@@ -212,6 +209,8 @@ oslModule osl_loadModuleRelativeAscii(
}
}
+#endif // !DISABLE_DYNLOADING
+
/*****************************************************************************/
/* osl_getModuleHandle */
/*****************************************************************************/
@@ -227,6 +226,8 @@ osl_getModuleHandle(rtl_uString *, oslModule *pResult)
return sal_True;
}
+#ifndef DISABLE_DYNLOADING
+
/*****************************************************************************/
/* osl_unloadModule */
/*****************************************************************************/
@@ -234,7 +235,6 @@ void SAL_CALL osl_unloadModule(oslModule hModule)
{
if (hModule)
{
-#ifndef DISABLE_DYNLOADING
#ifdef ANDROID
int nRet = lo_dlclose(hModule);
#else
@@ -242,10 +242,11 @@ void SAL_CALL osl_unloadModule(oslModule hModule)
#endif
SAL_INFO_IF(
nRet != 0, "sal.osl", "dlclose(" << hModule << "): " << dlerror());
-#endif /* ifndef DISABLE_DYNLOADING */
}
}
+#endif // !DISABLE_DYNLOADING
+
/*****************************************************************************/
/* osl_getSymbol */
/*****************************************************************************/