From 0f00dba88347333e466bcf6de030dc4a05fd4df2 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 11 Mar 2024 10:08:13 +0100 Subject: [PATCH] dix: workaround for win32 name clash on CreateWindow() The problem is, ming32 headers unconditionally define CreateWindow() to alias CreateWindowA() in winuser.h, which is included by windows.h, which is included by *a lot* common headers. So it highly depends on the exact include order, whether it works. (also weird things could happen, e.g. the Xserver's CreateWindow() ending up renamed to CreateWindowA(), ...) Until we've found a really clean solution to this problem (which might involve fixing mingw32 first), just add a little workaround by undef'ing CreateWindow symbol whereever necessary. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: (cherry picked from commit 1ca48d0a48dbec38d2765d8626f7983751226966) --- dix/dispatch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dix/dispatch.c b/dix/dispatch.c index e3a254e63..1d34f1db7 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -128,6 +128,9 @@ Equipment Corporation. #include "client.h" #include "xfixesint.h" +// temporary workaround for win32/mingw32 name clash +#undef CreateWindow + #ifdef XSERVER_DTRACE #include "registry.h" #include "probes.h"