From 9a52bf1d5cfdd01c6d5ce6e41bf1a432f9a29e7f Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 16 Nov 2011 17:18:45 +0200 Subject: Use lo_dlopen() on Android --- cppunit/android.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cppunit') diff --git a/cppunit/android.patch b/cppunit/android.patch index 7d88a82cfbef..7628f5f9877f 100644 --- a/cppunit/android.patch +++ b/cppunit/android.patch @@ -33,3 +33,21 @@ # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 +--- misc/cppunit-1.12.1/src/cppunit/UnixDynamicLibraryManager.cpp ++++ misc/build/cppunit-1.12.1/src/cppunit/UnixDynamicLibraryManager.cpp +@@ -13,7 +13,15 @@ + DynamicLibraryManager::LibraryHandle + DynamicLibraryManager::doLoadLibrary( const std::string &libraryName ) + { ++#ifdef __ANDROID__ ++ // Use our enhanced dlopen() wrapper, see sal/osl/android/jni/lo-wrapper.c ++ void *(*lo_dlopen)(const char *) = (void *(*)(const char *)) dlsym( RTLD_DEFAULT, "lo_dlopen" ); ++ if (lo_dlopen == NULL) ++ return NULL; ++ return (*lo_dlopen)( libraryName.c_str() ); ++#else + return ::dlopen( libraryName.c_str(), RTLD_NOW | RTLD_GLOBAL ); ++#endif + } + + -- cgit v1.2.3