From 0e2458697848cf8c89c9d57fa9b64f0ea7bd0877 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 28 Oct 2012 10:08:39 +0000 Subject: xlib/shm: Use shmstr.h instead of shmproto.h if available Before it was known as shmproto.h, the wire protocol definition was to be found in shmstr.h, so if we don't have the current version of libXext try to use the older includes. Reported-by: Sebastian Haas Signed-off-by: Chris Wilson --- configure.ac | 2 +- src/cairo-xlib-surface-shm.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 021ec8e2b..f523284ff 100644 --- a/configure.ac +++ b/configure.ac @@ -106,7 +106,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib, Xlib, auto, [ AC_MSG_RESULT(assuming no)) fi - AC_CHECK_HEADERS([X11/extensions/XShm.h X11/extensions/shmproto.h], [], [], + AC_CHECK_HEADERS([X11/extensions/XShm.h X11/extensions/shmproto.h X11/extensions/shmstr.h], [], [], [#include #include ]) ]) diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c index a3d4385cb..44e6284b1 100644 --- a/src/cairo-xlib-surface-shm.c +++ b/src/cairo-xlib-surface-shm.c @@ -42,7 +42,7 @@ #include "cairo-xlib-private.h" #include "cairo-xlib-surface-private.h" -#if !HAVE_X11_EXTENSIONS_XSHM_H || !HAVE_X11_EXTENSIONS_SHMPROTO_H +#if !HAVE_X11_EXTENSIONS_XSHM_H || !(HAVE_X11_EXTENSIONS_SHMPROTO_H || HAVE_X11_EXTENSIONS_SHMSTR_H) void _cairo_xlib_display_init_shm (cairo_xlib_display_t *display) {} cairo_surface_t * @@ -144,7 +144,11 @@ void _cairo_xlib_display_fini_shm (cairo_xlib_display_t *display) {} #include #include #include +#if HAVE_X11_EXTENSIONS_SHMPROTO_H #include +#elif HAVE_X11_EXTENSIONS_SHMSTR_H +#include +#endif #include #include -- cgit v1.2.1