diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-09-13 12:51:51 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-09-13 12:52:11 +0300 |
commit | 3c2c29613023f67fb8a29c68dc5f931051e6b9b0 (patch) | |
tree | 0531426c2765d19f52e8cd0e9f0e67369c02dc55 /intern/cycles | |
parent | 8068b89a681c467f3d449b9ddc2ebec5b817c2fc (diff) |
Fix compilation error on Windows after recent change
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/device/oneapi/device.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/device/oneapi/device.cpp b/intern/cycles/device/oneapi/device.cpp index f0d90fb504f..4aa307e9300 100644 --- a/intern/cycles/device/oneapi/device.cpp +++ b/intern/cycles/device/oneapi/device.cpp @@ -25,10 +25,12 @@ static OneAPIDLLInterface oneapi_dll; #ifdef _WIN32 # define LOAD_ONEAPI_SHARED_LIBRARY(path) (void *)(LoadLibrary(path)) +# define LOAD_ONEAPI_SHARED_LIBRARY_ERROR() GetLastError() # define FREE_SHARED_LIBRARY(handle) FreeLibrary((HMODULE)handle) # define GET_SHARED_LIBRARY_SYMBOL(handle, name) GetProcAddress((HMODULE)handle, name) #elif __linux__ # define LOAD_ONEAPI_SHARED_LIBRARY(path) dlopen(path, RTLD_NOW) +# define LOAD_ONEAPI_SHARED_LIBRARY_ERROR() dlerror() # define FREE_SHARED_LIBRARY(handle) dlclose(handle) # define GET_SHARED_LIBRARY_SYMBOL(handle, name) dlsym(handle, name) #endif @@ -49,7 +51,8 @@ bool device_oneapi_init() /* This shouldn't happen, but it still makes sense to have a branch for this. */ if (lib_handle == NULL) { - LOG(ERROR) << "oneAPI kernel shared library cannot be loaded: " << dlerror(); + LOG(ERROR) << "oneAPI kernel shared library cannot be loaded: " + << LOAD_ONEAPI_SHARED_LIBRARY_ERROR(); return false; } |