Kaydet (Commit) 21c0c69d authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Use lo_dladdr() on Android

üst 232ad7da
...@@ -95,9 +95,19 @@ static sal_Bool getModulePathFromAddress(void * address, rtl_String ** path) { ...@@ -95,9 +95,19 @@ static sal_Bool getModulePathFromAddress(void * address, rtl_String ** path) {
#else #else
Dl_info dl_info; Dl_info dl_info;
if ((result = dladdr(address, &dl_info)) != 0) #ifdef ANDROID
int (*lo_dladdr)(void *, Dl_info *) = dlsym(RTLD_DEFAULT, "lo_dladdr");
result = (*lo_dladdr)(address, &dl_info);
#else
result = dladdr(address, &dl_info)
#endif
if (result != 0)
{ {
rtl_string_newFromStr(path, dl_info.dli_fname); rtl_string_newFromStr(path, dl_info.dli_fname);
#ifdef ANDROID
free((void *) dl_info.dli_fname);
#endif
result = sal_True; result = sal_True;
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment