From ec6ee0e09e2d59455241081af66fb3ba02def7e4 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 22 Apr 2019 10:41:27 +0000 Subject: [PATCH 2/5] gl: don't implicitly include X11 headers EGL/egl.h on my system includes X11 headers by default, which breaks compilation when they aren't available, even though Cairo doesn't need them. Fortunately, this only happens if MESA_EGL_NO_X11_HEADERS is not defined, so defining that allows Cairo to be built with GL enabled even when X11 isn't available. Only when the Xlib surface is enabled are the headers guaranteed to be available. In that case, MESA_EGL_NO_X11_HEADERS should not be defined, to preserve compatibility with users expecting Cairo to include these headers. (There are tests that make this assumption.) --- src/cairo-gl.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cairo-gl.h b/src/cairo-gl.h index 7cd869c76..a95b07bc3 100644 --- a/src/cairo-gl.h +++ b/src/cairo-gl.h @@ -127,6 +127,11 @@ cairo_gl_surface_create_for_dc (cairo_device_t *device, #endif #if CAIRO_HAS_EGL_FUNCTIONS + +#if !CAIRO_HAS_XLIB_SURFACE && !defined(MESA_EGL_NO_X11_HEADERS) +#define MESA_EGL_NO_X11_HEADERS +#endif + #include cairo_public cairo_device_t * -- 2.19.2