| 39 | } |
| 40 | |
| 41 | bool DynLibImpl::Load(const String& libraryPath, String* errorMessage) |
| 42 | { |
| 43 | String path = libraryPath; |
| 44 | |
| 45 | unsigned int pos = path.FindLast(".so"); |
| 46 | if (pos == String::npos || (path.GetLength() > pos+3 && path[pos+3] != '.')) |
| 47 | path += ".so"; |
| 48 | |
| 49 | dlerror(); // Clear error flag |
| 50 | m_handle = dlopen(path.GetConstBuffer(), RTLD_LAZY | RTLD_GLOBAL); |
| 51 | |
| 52 | if (m_handle) |
| 53 | return true; |
| 54 | else |
| 55 | { |
| 56 | *errorMessage = dlerror(); |
| 57 | return false; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | void DynLibImpl::Unload() |
| 62 | { |
nothing calls this directly
no test coverage detected