dispatch: Use epoxy_conservative_glx_dlsym when probing GLX

This path should also only load libGLX.so if possible.

Signed-off-by: Adam Jackson <ajax@redhat.com>
macos/v1.5.9
Adam Jackson 8 years ago
parent 91c9ecebd9
commit f81274b124
  1. 26
      src/dispatch_common.c

@ -500,6 +500,18 @@ epoxy_internal_has_gl_extension(const char *ext, bool invalid_op_mode)
} }
} }
void *
epoxy_conservative_glx_dlsym(const char *name, bool exit_if_fails)
{
#ifdef GLVND_GLX_LIB
/* prefer the glvnd library if it exists */
if (!api.glx_handle)
get_dlopen_handle(&api.glx_handle, GLVND_GLX_LIB, false);
#endif
return do_dlsym(&api.glx_handle, GLX_LIB, name, exit_if_fails);
}
/** /**
* Tests whether the currently bound context is EGL or GLX, trying to * Tests whether the currently bound context is EGL or GLX, trying to
* avoid loading libraries unless necessary. * avoid loading libraries unless necessary.
@ -541,7 +553,7 @@ epoxy_current_context_is_glx(void)
* Presumably they dlopened with RTLD_LOCAL, which hides it * Presumably they dlopened with RTLD_LOCAL, which hides it
* from us. Just go dlopen()ing likely libraries and try them. * from us. Just go dlopen()ing likely libraries and try them.
*/ */
sym = do_dlsym(&api.glx_handle, GLX_LIB, "glXGetCurrentContext", false); sym = epoxy_conservative_glx_dlsym("glXGetCurrentContext", false);
if (sym && glXGetCurrentContext()) if (sym && glXGetCurrentContext())
return true; return true;
@ -594,18 +606,6 @@ epoxy_egl_dlsym(const char *name)
return epoxy_conservative_egl_dlsym(name, true); return epoxy_conservative_egl_dlsym(name, true);
} }
void *
epoxy_conservative_glx_dlsym(const char *name, bool exit_if_fails)
{
#ifdef GLVND_GLX_LIB
/* prefer the glvnd library if it exists */
if (!api.glx_handle)
get_dlopen_handle(&api.glx_handle, GLVND_GLX_LIB, false);
#endif
return do_dlsym(&api.glx_handle, GLX_LIB, name, exit_if_fails);
}
void * void *
epoxy_glx_dlsym(const char *name) epoxy_glx_dlsym(const char *name)
{ {

Loading…
Cancel
Save