summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2011-08-21 17:33:43 +0300
committerTor Lillqvist <tml@iki.fi>2011-08-21 17:49:11 +0300
commitb6a9f3560abae7a2b7bb33f6b30e4413105ff4d7 (patch)
treeb08cfa1cdeb865a9125bc8073c90f48e53fcfedd /cppu
parentc209bef8e51e89d325d32104e28ddeb624675241 (diff)
Link cppu statically to gcc3_uno on iOS
Diffstat (limited to 'cppu')
-rw-r--r--cppu/inc/uno/environment.h6
-rw-r--r--cppu/source/uno/lbenv.cxx10
-rw-r--r--cppu/source/uno/loadmodule.cxx4
3 files changed, 15 insertions, 5 deletions
diff --git a/cppu/inc/uno/environment.h b/cppu/inc/uno/environment.h
index 81c0b179ea7b..5ef4a5de5323 100644
--- a/cppu/inc/uno/environment.h
+++ b/cppu/inc/uno/environment.h
@@ -375,7 +375,11 @@ void SAL_CALL uno_Environment_enter(uno_Environment * pEnv)
int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pReason)
SAL_THROW_EXTERN_C();
-
+#ifdef IOS
+/* We link statically on iOS and have just one kind of environment */
+void SAL_CALL gcc3_uno_initEnvironment(uno_Environment *pCppEnv)
+ SAL_THROW_EXTERN_C();
+#endif
#ifdef __cplusplus
}
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index 651e6862fba7..faad5446971a 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -1064,6 +1064,14 @@ static bool loadEnv(OUString const & cLibStem,
uno_Environment * pEnv,
void * /*pContext*/)
{
+#ifdef IOS
+ oslModule hMod;
+ uno_initEnvironmentFunc fpInit = NULL;
+
+ if (cLibStem.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("gcc3_uno")) )
+ fpInit = gcc3_uno_initEnvironment;
+ osl_getModuleHandle( NULL, &hMod );
+#else
// late init with some code from matching uno language binding
// will be unloaded by environment
oslModule hMod = cppu::detail::loadModule( cLibStem );
@@ -1074,6 +1082,8 @@ static bool loadEnv(OUString const & cLibStem,
OUString aSymbolName(RTL_CONSTASCII_USTRINGPARAM(UNO_INIT_ENVIRONMENT));
uno_initEnvironmentFunc fpInit = (uno_initEnvironmentFunc)
::osl_getFunctionSymbol( hMod, aSymbolName.pData );
+#endif
+
if (!fpInit)
{
::osl_unloadModule( hMod );
diff --git a/cppu/source/uno/loadmodule.cxx b/cppu/source/uno/loadmodule.cxx
index ecc3ad9ce656..fe2b9d0b1a59 100644
--- a/cppu/source/uno/loadmodule.cxx
+++ b/cppu/source/uno/loadmodule.cxx
@@ -41,9 +41,6 @@
namespace cppu { namespace detail {
::oslModule loadModule(rtl::OUString const & name) {
-#ifdef IOS
- return NULL;
-#else
rtl::OUStringBuffer b;
#if defined SAL_DLLPREFIX
b.appendAscii(RTL_CONSTASCII_STRINGPARAM(SAL_DLLPREFIX));
@@ -54,7 +51,6 @@ namespace cppu { namespace detail {
reinterpret_cast< oslGenericFunction >(&loadModule),
b.makeStringAndClear().pData,
SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY);
-#endif
}
} }