summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2013-06-19 13:09:35 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2013-06-20 19:40:17 +0100
commitdeed8fb257d2d73d22941dd5bbdd4bab3ef1d3f8 (patch)
treed01fce19f344e10a96384963302cc0a09559c78d
parent4c2443397833e6170278b0822c69d5feabcbf599 (diff)
Undefine _XSERVER64clipboard-64bit-fix
Including any server header might define the macro _XSERVER64 on 64 bit machines. That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen. So let's undef that macro if necessary. Remove server directories from include path to ensure no server includes are included
-rw-r--r--hw/xwin/winclipboard/Makefile.am3
-rw-r--r--hw/xwin/winclipboard/textconv.c10
-rw-r--r--hw/xwin/winclipboard/thread.c9
-rw-r--r--hw/xwin/winclipboard/wndproc.c9
-rw-r--r--hw/xwin/winclipboard/xevents.c9
-rw-r--r--hw/xwin/winclipboard/xwinclip.c9
6 files changed, 47 insertions, 2 deletions
diff --git a/hw/xwin/winclipboard/Makefile.am b/hw/xwin/winclipboard/Makefile.am
index 614e7ec9e..b1c95f4ef 100644
--- a/hw/xwin/winclipboard/Makefile.am
+++ b/hw/xwin/winclipboard/Makefile.am
@@ -9,8 +9,7 @@ libXWinclipboard_la_SOURCES = \
libXWinclipboard_la_CFLAGS = -DHAVE_XWIN_CONFIG_H \
$(DIX_CFLAGS) \
- $(XWINMODULES_CFLAGS) \
- -I$(top_srcdir) -I$(top_srcdir)/miext/rootless -I$(srcdir)/..
+ $(XWINMODULES_CFLAGS)
libXWinclipboard_la_LDFLAGS = -static -no-undefined
diff --git a/hw/xwin/winclipboard/textconv.c b/hw/xwin/winclipboard/textconv.c
index 121636921..2870a9b8a 100644
--- a/hw/xwin/winclipboard/textconv.c
+++ b/hw/xwin/winclipboard/textconv.c
@@ -31,6 +31,16 @@
#ifdef HAVE_XWIN_CONFIG_H
#include <xwin-config.h>
#endif
+
+/*
+ * Including any server header might define the macro _XSERVER64 on 64 bit machines.
+ * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen.
+ * So let's undef that macro if necessary.
+ */
+#ifdef _XSERVER64
+#undef _XSERVER64
+#endif
+
#include <stdlib.h>
#include "internal.h"
diff --git a/hw/xwin/winclipboard/thread.c b/hw/xwin/winclipboard/thread.c
index e380a429f..15a515649 100644
--- a/hw/xwin/winclipboard/thread.c
+++ b/hw/xwin/winclipboard/thread.c
@@ -36,6 +36,15 @@
#define HAS_WINSOCK 1
#endif
+/*
+ * Including any server header might define the macro _XSERVER64 on 64 bit machines.
+ * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen.
+ * So let's undef that macro if necessary.
+ */
+#ifdef _XSERVER64
+#undef _XSERVER64
+#endif
+
#include <assert.h>
#include <unistd.h>
#include <fcntl.h>
diff --git a/hw/xwin/winclipboard/wndproc.c b/hw/xwin/winclipboard/wndproc.c
index 9418dfcff..a171ca595 100644
--- a/hw/xwin/winclipboard/wndproc.c
+++ b/hw/xwin/winclipboard/wndproc.c
@@ -34,6 +34,15 @@
#include <xwin-config.h>
#endif
+/*
+ * Including any server header might define the macro _XSERVER64 on 64 bit machines.
+ * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen.
+ * So let's undef that macro if necessary.
+ */
+#ifdef _XSERVER64
+#undef _XSERVER64
+#endif
+
#include <sys/types.h>
#include <sys/time.h>
diff --git a/hw/xwin/winclipboard/xevents.c b/hw/xwin/winclipboard/xevents.c
index 268ca9847..1622d3223 100644
--- a/hw/xwin/winclipboard/xevents.c
+++ b/hw/xwin/winclipboard/xevents.c
@@ -34,6 +34,15 @@
#include <xwin-config.h>
#endif
+/*
+ * Including any server header might define the macro _XSERVER64 on 64 bit machines.
+ * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen.
+ * So let's undef that macro if necessary.
+ */
+#ifdef _XSERVER64
+#undef _XSERVER64
+#endif
+
#include "internal.h"
#include <X11/Xutil.h>
#include <X11/Xatom.h>
diff --git a/hw/xwin/winclipboard/xwinclip.c b/hw/xwin/winclipboard/xwinclip.c
index 7b4577036..3677974c4 100644
--- a/hw/xwin/winclipboard/xwinclip.c
+++ b/hw/xwin/winclipboard/xwinclip.c
@@ -35,6 +35,15 @@
#include <xwin-config.h>
#endif
+/*
+ * Including any server header might define the macro _XSERVER64 on 64 bit machines.
+ * That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen.
+ * So let's undef that macro if necessary.
+ */
+#ifdef _XSERVER64
+#undef _XSERVER64
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>