Introduce anonymous namespace
The anonymous namespace is introduced to handle cases when linker can not find the caller. This usually happens when caller code was not loaded by dynamic linker; for example mono-generated code. Bug: http://b/25844435 Bug: http://b/22548808 Change-Id: I9e5b1d23c1c75bc78548d68e79216a6a943a33cf
This commit is contained in:
@@ -40,10 +40,12 @@ extern "C" const char* ns_get_dlopened_string() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* result = *static_cast<const char**>(dlsym(handle, "g_private_dlopened_string"));
|
||||
if (result != nullptr) {
|
||||
const char** result = static_cast<const char**>(dlsym(handle, "g_private_dlopened_string"));
|
||||
if (result == nullptr) {
|
||||
return nullptr;
|
||||
} else {
|
||||
g_dlopened = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
return *result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user