summaryrefslogtreecommitdiff
path: root/src/glx/create_context.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2012-01-02 17:44:31 -0800
committerDave Airlie <airlied@redhat.com>2012-01-03 10:24:10 +0000
commitf433fe015e903424d25673ebfe5dcb115381d753 (patch)
treea9e4ea319df624d074765348625ca5d8d79684a1 /src/glx/create_context.c
parentb518dfb513742984f27577d25566f93afd86d4fc (diff)
glx: Hack around versions of XCB that lack GLX_ARB_create_context support
A lot of tests in 'make check' will fail under these circumstances, but at least the build should work. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/glx/create_context.c')
-rw-r--r--src/glx/create_context.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/glx/create_context.c b/src/glx/create_context.c
index 41f08057a8d..11f9340a2e8 100644
--- a/src/glx/create_context.c
+++ b/src/glx/create_context.c
@@ -94,6 +94,7 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
* the protocol error and handle it. Part of handling the error is freeing
* the possibly non-NULL value returned by this function.
*/
+#ifdef XCB_GLX_CREATE_CONTEXT_ATTRIBS_ARB
cookie =
xcb_glx_create_context_attribs_arb_checked(c,
gc->xid,
@@ -105,6 +106,19 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config,
(const uint32_t *)
attrib_list);
err = xcb_request_check(c, cookie);
+#else
+ /* This is a hugely ugly hack to make things compile on systems that lack
+ * the proper XCB version.
+ */
+ memset(&cookie, 0, sizeof(cookie));
+
+ err = calloc(1, sizeof(*err));
+ err->error_code = BadRequest;
+ err->sequence = dpy->request;
+ err->resource_id = gc->xid;
+ err->minor_code = gc->majorOpcode;
+ err->major_code = 34;
+#endif
if (err != NULL) {
gc->vtable->destroy(gc);
gc = NULL;