[Mesa-dev] [PATCH 1/2] glx: Deliver an xlib style error to the application from an XCB error

Ian Romanick idr at freedesktop.org
Mon Dec 19 15:47:16 PST 2011


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glx/glx_error.c |   19 +++++++++++++++++++
 src/glx/glx_error.h |    4 ++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/glx/glx_error.c b/src/glx/glx_error.c
index 0855c35..b3860db 100644
--- a/src/glx/glx_error.c
+++ b/src/glx/glx_error.c
@@ -65,3 +65,22 @@ __glXSendError(Display * dpy, int_fast8_t errorCode, uint_fast32_t resourceID,
 
    UnlockDisplay(dpy);
 }
+
+void
+__glXSendErrorForXcb(Display * dpy, const xcb_generic_error_t *err)
+{
+   xError error;
+
+   LockDisplay(dpy);
+
+   error.type = X_Error;
+   error.errorCode = err->error_code;
+   error.sequenceNumber = err->sequence;
+   error.resourceID = err->resource_id;
+   error.minorCode = err->minor_code;
+   error.majorCode = err->major_code;
+
+   _XError(dpy, &error);
+
+   UnlockDisplay(dpy);
+}
diff --git a/src/glx/glx_error.h b/src/glx/glx_error.h
index 19be38b..eaf6b81 100644
--- a/src/glx/glx_error.h
+++ b/src/glx/glx_error.h
@@ -29,7 +29,11 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <X11/Xlib.h>
+#include <xcb/xcb.h>
 
 void __glXSendError(Display * dpy, int_fast8_t errorCode,
 		    uint_fast32_t resourceID, uint_fast16_t minorCode,
 		    bool coreX11error);
+
+_X_HIDDEN void __glXSendErrorForXcb(Display * dpy,
+				    const xcb_generic_error_t *err);
-- 
1.7.6.4



More information about the mesa-dev mailing list