Add conservative functions for checking platform symbols

When checking whether GLX or EGL are available on the system, we don't
want to use the internal API that forces an exit() on missing libraries
and symbols — as that would defeat the point.

Instead, we should have safe functions to call internally that simply
return a NULL pointer, so we can bail out ourselves in a controlled
fashion.
macos/v1.5.9
Emmanuele Bassi 8 years ago
parent acdd6d8bf8
commit 30b8a4cd2d
  1. 16
      src/dispatch_common.c
  2. 2
      src/dispatch_common.h

@ -568,16 +568,28 @@ epoxy_conservative_has_gl_extension(const char *ext)
return epoxy_internal_has_gl_extension(ext, true);
}
void *
epoxy_conservative_egl_dlsym(const char *name, bool exit_if_fails)
{
return do_dlsym(&api.egl_handle, EGL_LIB, name, exit_if_fails);
}
void *
epoxy_egl_dlsym(const char *name)
{
return do_dlsym(&api.egl_handle, EGL_LIB, name, true);
return epoxy_conservative_egl_dlsym(name, true);
}
void *
epoxy_conservative_glx_dlsym(const char *name, bool exit_if_fails)
{
return do_dlsym(&api.glx_handle, GLX_LIB, name, exit_if_fails);
}
void *
epoxy_glx_dlsym(const char *name)
{
return do_dlsym(&api.glx_handle, GLX_LIB, name, true);
return epoxy_conservative_glx_dlsym(name, true);
}
void *

@ -162,6 +162,8 @@ bool epoxy_conservative_has_glx_extension(const char *name);
int epoxy_conservative_egl_version(void);
bool epoxy_conservative_has_egl_extension(const char *name);
bool epoxy_conservative_has_wgl_extension(const char *name);
void *epoxy_conservative_egl_dlsym(const char *name, bool exit_if_fails);
void *epoxy_conservative_glx_dlsym(const char *name, bool exit_if_fails);
bool epoxy_extension_in_string(const char *extension_list, const char *ext);

Loading…
Cancel
Save