aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2016-06-29 21:44:08 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-06-30 00:19:02 +0200
commitbd2650ca0b17c8a8fc2bc278a998e10893d8147c (patch)
tree9b93ee34b76bd2e5eac7aabcb7217c6533cd1a78 /nx-X11/lib/X11
parent36d0fac779fcdece1d990c4f4e4a8590f319f2c7 (diff)
downloadnx-libs-bd2650ca0b17c8a8fc2bc278a998e10893d8147c.tar.gz
nx-libs-bd2650ca0b17c8a8fc2bc278a998e10893d8147c.tar.bz2
nx-libs-bd2650ca0b17c8a8fc2bc278a998e10893d8147c.zip
Port _XEatDataWords
This required for successful linking of libXrender against libNX_X11. Port from libXfixes commit b031e3b60fa1af9e49449f23d4a84395868be3ab We need this here to enable linking of current libXrender against libNX_X11 instead of the system's libX11 The original implementation of this function (libX11 commit 9f5d83706543696fc944c1835a403938c06f2cc5) uses xcb stuff which we do not have in libNX_X11. So we take a workaround from another lib. This workaround had been added temporarily to a couple of X extension libs, see e.g. https://lists.x.org/archives/xorg-devel/2013-July/036763.html.
Diffstat (limited to 'nx-X11/lib/X11')
-rw-r--r--nx-X11/lib/X11/XlibInt.c24
-rw-r--r--nx-X11/lib/X11/Xlibint.h4
2 files changed, 28 insertions, 0 deletions
diff --git a/nx-X11/lib/X11/XlibInt.c b/nx-X11/lib/X11/XlibInt.c
index 64028d723..175f5b92f 100644
--- a/nx-X11/lib/X11/XlibInt.c
+++ b/nx-X11/lib/X11/XlibInt.c
@@ -2751,6 +2751,30 @@ void _XEatData(
#undef SCRATCHSIZE
}
+/*
+ Port from libXfixes commit
+ b031e3b60fa1af9e49449f23d4a84395868be3ab We need this here to
+ enable linking of current libXrender against libNX_X11 instead of
+ the system's libX11
+
+ The original implementation of this function (libX11 commit
+ 9f5d83706543696fc944c1835a403938c06f2cc5) uses xcb stuff which we
+ do not have in libNX_X11. So we take a workaround from another
+ lib. This workaround had been implemented temporarily in a couple
+ of X libs, see e.g. https://lists.x.org/archives/xorg-devel/2013-July/036763.html.
+*/
+#include <X11/Xmd.h> /* for LONG64 on 64-bit platforms */
+#include <limits.h>
+
+void _XEatDataWords(Display *dpy, unsigned long n)
+{
+#ifndef LONG64
+ if (n >= (ULONG_MAX >> 2))
+ _XIOError(dpy);
+#endif
+ _XEatData (dpy, n << 2);
+}
+
/*
* _XEnq - Place event packets on the display's queue.
diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h
index a359efca1..ca3d28004 100644
--- a/nx-X11/lib/X11/Xlibint.h
+++ b/nx-X11/lib/X11/Xlibint.h
@@ -879,6 +879,10 @@ extern void _XEatData(
Display* /* dpy */,
unsigned long /* n */
);
+extern void _XEatDataWords(
+ Display* /* dpy */,
+ unsigned long /* n */
+);
extern char *_XAllocScratch(
Display* /* dpy */,
unsigned long /* nbytes */