aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-10-14 14:51:06 +1000
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:26 +0200
commit3597915f64c44552c16ce6e0acff9165e6009f9a (patch)
tree53ce8c9b7e50cd681a59d5cfcf4eaafef42146f4
parent3155b9bb225656eb1d3871b65110210a342e8c70 (diff)
downloadnx-libs-3597915f64c44552c16ce6e0acff9165e6009f9a.tar.gz
nx-libs-3597915f64c44552c16ce6e0acff9165e6009f9a.tar.bz2
nx-libs-3597915f64c44552c16ce6e0acff9165e6009f9a.zip
include: Add GetReqSized() for request buffers of specific size
Some XI2 requests change in size over different versions and libXi would need to hack around GetReq and GetReqExtra. Add a new GetReqSized so the library can explicitly specify the size of the request in 4-byte units. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
-rw-r--r--nx-X11/lib/X11/Xlibint.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h
index 8d7291d01..f4c648634 100644
--- a/nx-X11/lib/X11/Xlibint.h
+++ b/nx-X11/lib/X11/Xlibint.h
@@ -450,6 +450,18 @@ extern LockInfoPtr _Xglobal_lock;
*/
extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
+/* GetReqSized is the same as GetReq but allows the caller to specify the
+ * size in bytes. 'sz' must be a multiple of 4! */
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetReqSized(name, sz, req) \
+ req = (x##name##Req *) _XGetRequest(dpy, X_##name, sz)
+#else
+#define GetReqSized(name, sz, req) \
+ req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, sz)
+#endif
+
+
/*
* GetReq - Get the next available X request packet in the buffer and
* return it.