epoxy: don't rely on compiler to optimize-out unsupported glx stuff

…as building with debug on Android for example fails when linking due to
unsatisfied symbol glXGetProcAddressARB

Change-Id: Ibea56d182fcabff182b1622599950e3e7ebf3aaa
Reviewed-on: https://gerrit.libreoffice.org/42335
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
Christian Lohmaier 2017-09-15 17:49:41 +02:00
parent 7bb6e01782
commit 17d48dfe3a
2 changed files with 29 additions and 0 deletions

View file

@ -17,6 +17,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,epoxy, \
external/epoxy/epoxy.windows.api.patch \
external/epoxy/epoxy.noegl.by.default.patch \
external/epoxy/clang-cl.patch \
external/epoxy/epoxy.noglx_means_noglx.patch.1 \
))
# vim: set noet sw=4 ts=4:

View file

@ -0,0 +1,28 @@
diff -ur epoxy.org/src/dispatch_common.c epoxy/src/dispatch_common.c
--- epoxy.org/src/dispatch_common.c 2017-09-15 14:59:07.458635939 +0200
+++ epoxy/src/dispatch_common.c 2017-09-15 15:03:16.978088807 +0200
@@ -660,10 +660,13 @@
#elif defined(__APPLE__)
return epoxy_gl_dlsym(name);
#else
+#if PLATFORM_HAS_GLX
if (epoxy_current_context_is_glx()) {
return glXGetProcAddressARB((const GLubyte *)name);
- } else {
+ } else
+#endif
#if PLATFORM_HAS_EGL
+ {
GLenum egl_api = epoxy_egl_get_current_gl_context_api();
switch (egl_api) {
@@ -673,8 +676,8 @@
case EGL_NONE:
break;
}
-#endif
}
+#endif
errx(1, "Couldn't find current GLX or EGL context.\n");
#endif
}