diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2016-06-29 21:25:24 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-06-30 00:19:02 +0200 |
commit | 36d0fac779fcdece1d990c4f4e4a8590f319f2c7 (patch) | |
tree | 465c8e82a4aac8cc26b48b847a4637987f9a1872 /nx-X11/lib/X11/XlibInt.c | |
parent | c355dc91d35c74234c24dfbf013dfac98110d352 (diff) | |
download | nx-libs-36d0fac779fcdece1d990c4f4e4a8590f319f2c7.tar.gz nx-libs-36d0fac779fcdece1d990c4f4e4a8590f319f2c7.tar.bz2 nx-libs-36d0fac779fcdece1d990c4f4e4a8590f319f2c7.zip |
Backport of _XGetRequest()
To enable linking of a current libXrender libNX_X11 needs that symbol.
This is a (manual) backport of the following upstream libX11 commit
available at
https://cgit.freedesktop.org/xorg/lib/libX11/commit/src/XlibInt.c?id=4a060f993bf676cf21ad9784e010f54134da7b40:
Commit: 4a060f993bf676cf21ad9784e010f54134da7b40
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 17 Oct 2011 09:45:15 +1000
Subject: Add _XGetRequest as substitute for GetReq/GetReqExtra
Diffstat (limited to 'nx-X11/lib/X11/XlibInt.c')
-rw-r--r-- | nx-X11/lib/X11/XlibInt.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nx-X11/lib/X11/XlibInt.c b/nx-X11/lib/X11/XlibInt.c index 49535fe18..64028d723 100644 --- a/nx-X11/lib/X11/XlibInt.c +++ b/nx-X11/lib/X11/XlibInt.c @@ -3732,6 +3732,36 @@ Screen *_XScreenOfWindow (dpy, w) return NULL; } +/* + * WARNING: This implementation's pre-conditions and post-conditions + * must remain compatible with the old macro-based implementations of + * GetReq, GetReqExtra, GetResReq, and GetEmptyReq. The portions of the + * Display structure affected by those macros are part of libX11's + * ABI. + */ +void *_XGetRequest(Display *dpy, CARD8 type, size_t len) +{ + xReq *req; + + WORD64ALIGN + + if (dpy->bufptr + len > dpy->bufmax) + _XFlush(dpy); + + if (len % 4) + fprintf(stderr, + "Xlib: request %d length %zd not a multiple of 4.\n", + type, len); + + dpy->last_req = dpy->bufptr; + + req = (xReq*)dpy->bufptr; + req->reqType = type; + req->length = len / 4; + dpy->bufptr += len; + dpy->request++; + return req; +} #if defined(WIN32) |