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.h | |
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.h')
-rw-r--r-- | nx-X11/lib/X11/Xlibint.h | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index 474b77349..a359efca1 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -422,6 +422,19 @@ extern LockInfoPtr _Xglobal_lock; /* Leftover from CRAY support - was defined empty on all non-Cray systems */ #define WORD64ALIGN +/** + * Return a len-sized request buffer for the request type. This function may + * flush the output queue. + * + * @param dpy The display connection + * @param type The request type + * @param len Length of the request in bytes + * + * @returns A pointer to the request buffer with a few default values + * initialized. + */ +extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); + /* * GetReq - Get the next available X request packet in the buffer and * return it. @@ -433,23 +446,10 @@ extern LockInfoPtr _Xglobal_lock; #if !defined(UNIXCPP) || defined(ANSICPP) #define GetReq(name, req) \ - if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req))>>2;\ - dpy->bufptr += SIZEOF(x##name##Req);\ - dpy->request++ - + req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req)) #else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ #define GetReq(name, req) \ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req))>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req);\ - dpy->request++ + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req)) #endif /* GetReqExtra is the same as GetReq, but allocates "n" additional @@ -457,22 +457,10 @@ extern LockInfoPtr _Xglobal_lock; #if !defined(UNIXCPP) || defined(ANSICPP) #define GetReqExtra(name, n, req) \ - if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x##name##Req) + n;\ - dpy->request++ + req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req) + n) #else #define GetReqExtra(name, n, req) \ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\ - dpy->request++ + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req) + n) #endif |