winemac: Use standard dlopen() instead of the libwine wrappers.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-04-06 22:41:34 +02:00
parent 3760b7a9f8
commit 73effb1ab6
2 changed files with 10 additions and 13 deletions

View File

@ -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))

View File

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