summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorjan Iversen <jani@libreoffice.org>2018-01-12 13:08:59 +0100
committerMichael Meeks <michael.meeks@collabora.com>2018-10-30 17:00:47 +0000
commit87201719c61e48aac5ae70d58cc51b994792dfec (patch)
tree936b6b43174968c78daf362de345717daf925d16 /include
parent06c1fc413db0470ff8661b675796aeef891a00a5 (diff)
iOS, stop trying to do dynamic load in lok_init_2()
(Misleading original commit message; it is not "dynamic load" (dlopen()) that the code tried to do, but dlsym(). But indeed, simply call the function in question directly instead. --tml) LibreOfficeKit, tries traditionally to load a dylib, and locate the symbols, for iOS this is already linked to a single Kit.o. Code is changed to a simple call Change-Id: Ie94a447260cb3007e7e2b56c1b67896ad40d79d3 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitInit.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 5617a4eaa522..cce3e8f0343c 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -74,7 +74,6 @@ extern "C"
{
(void)pPath;
}
-#endif // IOS
static void *lok_dlsym(void *Hnd, const char *pName)
{
@@ -85,6 +84,7 @@ extern "C"
{
return dlclose(Hnd);
}
+#endif // IOS
#else
@@ -171,12 +171,12 @@ extern "C"
}
#endif
+#if !defined(IOS)
static void *lok_dlopen( const char *install_path, char ** _imp_lib )
{
char *imp_lib;
void *dlhandle;
-#if !defined(IOS)
size_t partial_length, imp_lib_size;
struct stat dir_st;
@@ -239,14 +239,10 @@ static void *lok_dlopen( const char *install_path, char ** _imp_lib )
return NULL;
}
}
-#else
- (void)install_path;
- imp_lib = strdup("the app executable");
- dlhandle = RTLD_MAIN_ONLY;
-#endif
*_imp_lib = imp_lib;
return dlhandle;
}
+#endif
typedef LibreOfficeKit *(LokHookFunction)( const char *install_path);
@@ -254,10 +250,14 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char *install_path, const char
typedef int (LokHookPreInit) ( const char *install_path, const char *user_profile_url );
+extern __attribute__ ((visibility("default")))
+ LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_path);
+
static LibreOfficeKit *lok_init_2( const char *install_path, const char *user_profile_url )
{
- char *imp_lib;
+#if !defined(IOS)
void *dlhandle;
+ char *imp_lib;
LokHookFunction *pSym;
LokHookFunction2 *pSym2;
@@ -294,6 +294,9 @@ static LibreOfficeKit *lok_init_2( const char *install_path, const char *user_p
// dlhandle is "leaked"
// coverity[leaked_storage]
return pSym2( install_path, user_profile_url );
+#else
+ return libreofficekit_hook_2( install_path, user_profile_url );
+#endif
}
static LOK_TOLERATE_UNUSED