summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boilerplate/cairo-boilerplate-xcb.c6
-rw-r--r--configure.ac5
2 files changed, 10 insertions, 1 deletions
diff --git a/boilerplate/cairo-boilerplate-xcb.c b/boilerplate/cairo-boilerplate-xcb.c
index ed173e68..0e5c3b94 100644
--- a/boilerplate/cairo-boilerplate-xcb.c
+++ b/boilerplate/cairo-boilerplate-xcb.c
@@ -564,9 +564,15 @@ _cairo_boilerplate_xcb_finish_surface (cairo_surface_t *surface)
if (ev->response_type == 0 /* trust me! */) {
xcb_generic_error_t *error = (xcb_generic_error_t *) ev;
+#if XCB_GENERIC_ERROR_HAS_MAJOR_MINOR_CODES
fprintf (stderr,
"Detected error during xcb run: %d major=%d, minor=%d\n",
error->error_code, error->major_code, error->minor_code);
+#else
+ fprintf (stderr,
+ "Detected error during xcb run: %d\n",
+ error->error_code);
+#endif
free (error);
status = CAIRO_STATUS_WRITE_ERROR;
diff --git a/configure.ac b/configure.ac
index 7d0cde0b..b483dd24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,10 +116,13 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib_xrender, Xlib Xrender, auto, [
dnl ===========================================================================
CAIRO_ENABLE_SURFACE_BACKEND(xcb, XCB, no, [
- xcb_REQUIRES="xcb >= 0.9.92 xcb-render >= 0.9.92"
+ xcb_REQUIRES="xcb >= 1.1.92 xcb-render >= 0.9.92"
PKG_CHECK_MODULES(xcb, $xcb_REQUIRES, ,
[AC_MSG_RESULT(no)
use_xcb="no (requires $xcb_REQUIRES http://xcb.freedesktop.org)"])
+ if $PKG_CONFIG --atleast-version=1.4 xcb; then
+ CAIRO_CFLAGS="$CAIRO_CFLAGS -DXCB_GENERIC_ERROR_HAS_MAJOR_MINOR_CODES"
+ fi
])
CAIRO_ENABLE_FUNCTIONS(xlib_xcb, Xlib/XCB, no, [