[cairo] [PATCH] Allow cairo-xlib-surface.c to compile on older systems.
Damian Frank
damian.frank at gmail.com
Tue Aug 11 20:22:38 PDT 2009
Recent changes caused _cairo_xlib_surface_acquire_pattern_surface
to depend on gradient-related definitions in libXrender's
headers. Unfortunately, those definitions are of recent vintage,
so this breaks compiling on distributions with older libXrender
versions. This patch ensures that, if those definitions are
absent, the code that uses them isn't compiled; instead, a
fallback is used.
---
src/cairo-xlib-surface.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 150e6e0..2e63e47 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1910,6 +1910,10 @@ _cairo_xlib_surface_acquire_pattern_surface
(cairo_xlib_surface_t *dst,
Picture picture;
unsigned int i;
+#if RENDER_MAJOR == 0 && RENDER_MINOR < 10
+ /* gradient definitions not present in Xrender headers */
+ break;
+#else
if (dst->buggy_gradients)
break;
@@ -2048,6 +2052,7 @@ _cairo_xlib_surface_acquire_pattern_surface
(cairo_xlib_surface_t *dst,
*surface_out = surface;
return CAIRO_STATUS_SUCCESS;
+#endif /* #if RENDER_MAJOR/MINOR imply support for gradients */
}
default:
ASSERT_NOT_REACHED;
--
1.6.0.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20090811/113e663a/attachment.html
More information about the cairo
mailing list