From 5de1867fbb0a336ff3fdc92cbf734849f6111b1b Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Wed, 23 Jul 2008 01:00:26 +0200 Subject: [PATCH] [Xephyr] Fix #15839 Make sure the _XSERVER64 macro is not defined in Xlib client code. That macro is meant to be define only on pure server code, when necessary. --- hw/kdrive/ephyr/XF86dri.c | 10 ++++++++++ hw/kdrive/ephyr/ephyrhostglx.c | 11 +++++++++++ hw/kdrive/ephyr/ephyrhostvideo.c | 10 ++++++++++ hw/kdrive/ephyr/hostx.c | 12 ++++++++++++ 4 files changed, 43 insertions(+) diff --git a/hw/kdrive/ephyr/XF86dri.c b/hw/kdrive/ephyr/XF86dri.c index be65edf5b..31f796331 100644 --- a/hw/kdrive/ephyr/XF86dri.c +++ b/hw/kdrive/ephyr/XF86dri.c @@ -45,6 +45,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifdef HAVE_CONFIG_H #include #endif +/* + * including some server headers (like kdrive-config.h) + * might define the macro _XSERVER64 + * on 64 bits 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 /* THIS IS NOT AN X CONSORTIUM STANDARD */ diff --git a/hw/kdrive/ephyr/ephyrhostglx.c b/hw/kdrive/ephyr/ephyrhostglx.c index 6d783d279..a05bba2e3 100644 --- a/hw/kdrive/ephyr/ephyrhostglx.c +++ b/hw/kdrive/ephyr/ephyrhostglx.c @@ -31,6 +31,17 @@ #include #endif +/* + * including some server headers (like kdrive-config.h) + * might define the macro _XSERVER64 + * on 64 bits 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 #include #include diff --git a/hw/kdrive/ephyr/ephyrhostvideo.c b/hw/kdrive/ephyr/ephyrhostvideo.c index 562c2a4e8..41c0b755b 100644 --- a/hw/kdrive/ephyr/ephyrhostvideo.c +++ b/hw/kdrive/ephyr/ephyrhostvideo.c @@ -28,6 +28,16 @@ #ifdef HAVE_CONFIG_H #include #endif +/* + * including some server headers (like kdrive-config.h) + * might define the macro _XSERVER64 + * on 64 bits 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 #include #include diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 171d78c9a..1bc95a8fc 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -27,6 +27,18 @@ #include #endif +/* + * including some server headers (like kdrive-config.h) + * might define the macro _XSERVER64 + * on 64 bits 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 "hostx.h" #include