[Bf-blender-cvs] [3c2c2961302] master: Fix compilation error on Windows after recent change

Sergey Sharybin noreply at git.blender.org
Tue Sep 13 11:52:14 CEST 2022


Commit: 3c2c29613023f67fb8a29c68dc5f931051e6b9b0
Author: Sergey Sharybin
Date:   Tue Sep 13 11:51:51 2022 +0200
Branches: master
https://developer.blender.org/rB3c2c29613023f67fb8a29c68dc5f931051e6b9b0

Fix compilation error on Windows after recent change

===================================================================

M	intern/cycles/device/oneapi/device.cpp

===================================================================

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;
   }



More information about the Bf-blender-cvs mailing list