From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/vulkan.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/winemac.drv/vulkan.c b/dlls/winemac.drv/vulkan.c index 67273b8f20b..de99e4035bc 100644 --- a/dlls/winemac.drv/vulkan.c +++ b/dlls/winemac.drv/vulkan.c @@ -101,12 +101,12 @@ static inline struct wine_vk_surface *surface_from_handle(VkSurfaceKHR handle)
static void *vulkan_handle;
-static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context) +static void wine_vk_init(void) { if (!(vulkan_handle = dlopen(SONAME_LIBMOLTENVK, RTLD_NOW))) { ERR("Failed to load %s\n", SONAME_LIBMOLTENVK); - return TRUE; + return; }
#define LOAD_FUNCPTR(f) if ((p##f = dlsym(vulkan_handle, #f)) == NULL) goto fail; @@ -130,12 +130,11 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context) LOAD_FUNCPTR(vkQueuePresentKHR) #undef LOAD_FUNCPTR
- return TRUE; + return;
fail: dlclose(vulkan_handle); vulkan_handle = NULL; - return TRUE; }
/* Helper function for converting between win32 and MoltenVK compatible VkInstanceCreateInfo. @@ -625,7 +624,7 @@ static void *macdrv_get_vk_instance_proc_addr(VkInstance instance, const char *n
static const struct vulkan_funcs *get_vulkan_driver(UINT version) { - static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; + static pthread_once_t init_once = PTHREAD_ONCE_INIT;
if (version != WINE_VULKAN_DRIVER_VERSION) { @@ -633,7 +632,7 @@ static const struct vulkan_funcs *get_vulkan_driver(UINT version) return NULL; }
- InitOnceExecuteOnce(&init_once, wine_vk_init, NULL, NULL); + pthread_once(&init_once, wine_vk_init); if (vulkan_handle) return &vulkan_funcs;