From 3c2c29613023f67fb8a29c68dc5f931051e6b9b0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 13 Sep 2022 11:51:51 +0200 Subject: Fix compilation error on Windows after recent change --- intern/cycles/device/oneapi/device.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'intern/cycles/device') 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; } -- cgit v1.2.3