[PATCH] miext/sync: Prepare for libxshmfence API change

Keith Packard keithp at keithp.com
Thu Nov 21 22:58:41 PST 2013


libxshmfence has an unfortunate 'int32_t' type for the mapped fence;
it will change to exposing a 'struct shmfence' instead, which is nice
and opaque and offers fine type checking across the API.

This patch checks to see if that new version of libxshmfence has been
installed and uses the new type when available.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 miext/sync/misyncshm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/miext/sync/misyncshm.c b/miext/sync/misyncshm.c
index 59f99fb..ec12423 100644
--- a/miext/sync/misyncshm.c
+++ b/miext/sync/misyncshm.c
@@ -37,9 +37,15 @@
 
 static DevPrivateKeyRec syncShmFencePrivateKey;
 
+#if HAVE_STRUCT_XSHMFENCE
+typedef struct xshmfence *fence_type;
+#else
+typedef int32_t *fence_type;
+#endif
+
 typedef struct _SyncShmFencePrivate {
-    int32_t             *fence;
-    int                 fd;
+    fence_type  fence;
+    int         fd;
 } SyncShmFencePrivateRec, *SyncShmFencePrivatePtr;
 
 #define SYNC_FENCE_PRIV(pFence) \
-- 
1.8.4.2



More information about the xorg-devel mailing list