Alexandre Julliard : winemac: Use standard dlopen() instead of the libwine wrappers.
Alexandre Julliard
julliard at winehq.org
Tue Apr 7 15:27:15 CDT 2020
Module: wine
Branch: master
Commit: 73effb1ab66606dcdcd3cff880ea36fa90388c8e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=73effb1ab66606dcdcd3cff880ea36fa90388c8e
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Apr 6 22:41:34 2020 +0200
winemac: Use standard dlopen() instead of the libwine wrappers.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winemac.drv/opengl.c | 16 +++++++---------
dlls/winemac.drv/vulkan.c | 7 +++----
2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c
index c60a22719a..402dd8190c 100644
--- a/dlls/winemac.drv/opengl.c
+++ b/dlls/winemac.drv/opengl.c
@@ -27,7 +27,6 @@
#include "winuser.h"
#include "winternl.h"
#include "winnt.h"
-#include "wine/library.h"
#include "wine/debug.h"
#include "wine/wgl.h"
#include "wine/wgl_driver.h"
@@ -4247,7 +4246,6 @@ static BOOL init_opengl(void)
{
static BOOL init_done = FALSE;
unsigned int i;
- char buffer[200];
if (init_done) return (opengl_handle != NULL);
init_done = TRUE;
@@ -4261,17 +4259,17 @@ static BOOL init_opengl(void)
return FALSE;
}
- opengl_handle = wine_dlopen("/System/Library/Frameworks/OpenGL.framework/OpenGL", RTLD_LAZY|RTLD_LOCAL|RTLD_NOLOAD, buffer, sizeof(buffer));
+ opengl_handle = dlopen("/System/Library/Frameworks/OpenGL.framework/OpenGL", RTLD_LAZY|RTLD_LOCAL|RTLD_NOLOAD);
if (!opengl_handle)
{
- ERR("Failed to load OpenGL: %s\n", buffer);
+ ERR("Failed to load OpenGL: %s\n", dlerror());
ERR("OpenGL support is disabled.\n");
return FALSE;
}
for (i = 0; i < ARRAY_SIZE(opengl_func_names); i++)
{
- if (!(((void **)&opengl_funcs.gl)[i] = wine_dlsym(opengl_handle, opengl_func_names[i], NULL, 0)))
+ if (!(((void **)&opengl_funcs.gl)[i] = dlsym(opengl_handle, opengl_func_names[i])))
{
ERR("%s not found in OpenGL, disabling.\n", opengl_func_names[i]);
goto failed;
@@ -4296,12 +4294,12 @@ static BOOL init_opengl(void)
/* redirect some OpenGL extension functions */
#define REDIRECT(func) \
- do { if ((p##func = wine_dlsym(opengl_handle, #func, NULL, 0))) { opengl_funcs.ext.p_##func = macdrv_##func; } } while(0)
+ do { if ((p##func = dlsym(opengl_handle, #func))) { opengl_funcs.ext.p_##func = macdrv_##func; } } while(0)
REDIRECT(glCopyColorTable);
#undef REDIRECT
if (gluCheckExtension((GLubyte*)"GL_APPLE_flush_render", (GLubyte*)gl_info.glExtensions))
- pglFlushRenderAPPLE = wine_dlsym(opengl_handle, "glFlushRenderAPPLE", NULL, 0);
+ pglFlushRenderAPPLE = dlsym(opengl_handle, "glFlushRenderAPPLE");
load_extensions();
if (!init_pixel_formats())
@@ -4310,7 +4308,7 @@ static BOOL init_opengl(void)
return TRUE;
failed:
- wine_dlclose(opengl_handle, NULL, 0);
+ dlclose(opengl_handle);
opengl_handle = NULL;
return FALSE;
}
@@ -4479,7 +4477,7 @@ static PROC macdrv_wglGetProcAddress(const char *proc)
void *ret;
if (!strncmp(proc, "wgl", 3)) return NULL;
- ret = wine_dlsym(opengl_handle, proc, NULL, 0);
+ ret = dlsym(opengl_handle, proc);
if (ret)
{
if (TRACE_ON(wgl))
diff --git a/dlls/winemac.drv/vulkan.c b/dlls/winemac.drv/vulkan.c
index 5d15eeda2b..dd92231d3e 100644
--- a/dlls/winemac.drv/vulkan.c
+++ b/dlls/winemac.drv/vulkan.c
@@ -33,7 +33,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
-#include "wine/library.h"
#define VK_NO_PROTOTYPES
#define WINE_VK_HOST
@@ -107,13 +106,13 @@ static void *vulkan_handle;
static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
{
- if (!(vulkan_handle = wine_dlopen(SONAME_LIBMOLTENVK, RTLD_NOW, NULL, 0)))
+ if (!(vulkan_handle = dlopen(SONAME_LIBMOLTENVK, RTLD_NOW)))
{
ERR("Failed to load %s\n", SONAME_LIBMOLTENVK);
return TRUE;
}
-#define LOAD_FUNCPTR(f) if ((p##f = wine_dlsym(vulkan_handle, #f, NULL, 0)) == NULL) goto fail;
+#define LOAD_FUNCPTR(f) if ((p##f = dlsym(vulkan_handle, #f)) == NULL) goto fail;
LOAD_FUNCPTR(vkCreateInstance)
LOAD_FUNCPTR(vkCreateSwapchainKHR)
LOAD_FUNCPTR(vkCreateMacOSSurfaceMVK)
@@ -137,7 +136,7 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
return TRUE;
fail:
- wine_dlclose(vulkan_handle, NULL, 0);
+ dlclose(vulkan_handle);
vulkan_handle = NULL;
return TRUE;
}
More information about the wine-cvs
mailing list