(!1987) ephyr: workaround for name clash between Xlib and Xserver

A slight change in include order can cause Xlib to be included and defining
"GC" type, which is conflicting with Xserver's own type by same name.

As long as MR !1393 hasn't merged yet, we need to do an ugly workaround
using some preprocessor black magic.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-05-19 18:48:48 +02:00
parent 4543a5d5e2
commit 8ae0a2d2ab

View File

@ -37,6 +37,14 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/mman.h> #include <sys/mman.h>
// workaround for name clash between Xlib and Xserver:
// GL might pull in Xlib.h (why ?), which is definining a type "GC", that's
// conflicting with Xserver's "GC" type.
#define GC XlibGC
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#undef GC
#include "dix/input_priv.h" #include "dix/input_priv.h"
#include "hostx.h" #include "hostx.h"