summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-07-12 14:03:35 -0400
committerAdam Jackson <ajax@redhat.com>2017-07-12 14:03:35 -0400
commitf81274b12470a0ce8678465112998708f63c3559 (patch)
treecc2e6daf39ac466c76f5f5ea44465c66360eb0fe /src
parent91c9ecebd963c7af1f0ef3d1333ca0a723bdd6d4 (diff)
downloadlibepoxy-f81274b12470a0ce8678465112998708f63c3559.tar.gz
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>
Diffstat (limited to 'src')
-rw-r--r--src/dispatch_common.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/dispatch_common.c b/src/dispatch_common.c
index a7c2f74..48bd3f5 100644
--- a/src/dispatch_common.c
+++ b/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
* avoid loading libraries unless necessary.
@@ -541,7 +553,7 @@ epoxy_current_context_is_glx(void)
* Presumably they dlopened with RTLD_LOCAL, which hides it
* 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())
return true;
@@ -595,18 +607,6 @@ epoxy_egl_dlsym(const char *name)
}
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 *
epoxy_glx_dlsym(const char *name)
{
return epoxy_conservative_glx_dlsym(name, true);