From 1691752dd29d661552700d9bcac5d3a3953fb91a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 7 Oct 2012 07:45:10 +0300 Subject: 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 --- sal/osl/unx/module.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'sal/osl/unx') 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 */ /*****************************************************************************/ -- cgit