| 3484 | } |
| 3485 | |
| 3486 | void* loadFunction(void* lib, const char* func_name) { |
| 3487 | void* dlfcn = nullptr; |
| 3488 | |
| 3489 | #if defined(__unixish__) |
| 3490 | dlfcn = dlsym(lib, func_name); |
| 3491 | if (dlfcn == nullptr) { |
| 3492 | TraceEvent(SevWarn, "LoadFunctionFailed").detail("Function", func_name).detail("Error", dlerror()); |
| 3493 | } |
| 3494 | #else |
| 3495 | dlfcn = GetProcAddress((HINSTANCE)lib, func_name); |
| 3496 | if (dlfcn == nullptr) { |
| 3497 | TraceEvent(SevWarn, "LoadFunctionFailed").detail("Function", func_name).GetLastError(); |
| 3498 | } |
| 3499 | #endif |
| 3500 | |
| 3501 | return dlfcn; |
| 3502 | } |
| 3503 | |
| 3504 | void closeLibrary(void* handle) { |
| 3505 | #ifdef __unixish__ |
no test coverage detected