!15 去掉MUSL编译宏

Merge pull request !15 from cuijiawei/master
This commit is contained in:
openharmony_ci 2023-03-14 11:17:23 +00:00 committed by Gitee
commit 86b0d4f4d0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -52,9 +52,6 @@ bool InitOpenCL() {
}
bool UnLoadOpenCLLibrary(void *handle) {
#ifdef __MUSL__
return true;
#else
if (handle != nullptr) {
if (dlclose(handle) != 0) {
return false;
@ -62,7 +59,6 @@ bool UnLoadOpenCLLibrary(void *handle) {
return true;
}
return true;
#endif
}
bool LoadLibraryFromPath(const std::string &library_path, void **handle_ptr) {
@ -79,7 +75,6 @@ bool LoadLibraryFromPath(const std::string &library_path, void **handle_ptr) {
#define LOAD_OPENCL_FUNCTION_PTR(func_name) \
func_name = reinterpret_cast<func_name##Func>(dlsym(*handle_ptr, #func_name)); \
if (func_name == nullptr) { \
UnLoadOpenCLLibrary(*handle_ptr); \
return false; \
}
@ -155,9 +150,6 @@ bool LoadOpenCLLibrary(void **handle_ptr) {
if (handle_ptr == nullptr) {
return false;
}
if (*handle_ptr != nullptr) {
return true;
}
auto it =
std::find_if(g_opencl_library_paths.begin(), g_opencl_library_paths.end(),
[&](const std::string &lib_path) { return OHOS::LoadLibraryFromPath(lib_path, handle_ptr); });