From 89ec9276fc96569172bf74181dd92bbb20453dd7 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 30 May 2025 11:46:36 +0200 Subject: [PATCH] EGL: undef X11 macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Including egl.h may transitively include X headers which define a bunch of macros that clash against our code. Undef these macros just after EGL is included. This was already done locally in eglfs, but the same problem appears in any code that uses qt_egl_p.h, like the Wayland platform plugin. Change-Id: I2fbd617f57de6ae7366795aabacd81c639903699 Reviewed-by: Tor Arne Vestbø --- src/gui/opengl/platform/egl/qt_egl_p.h | 14 ++++++++++++++ src/plugins/platforms/eglfs/api/qeglfsglobal_p.h | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/gui/opengl/platform/egl/qt_egl_p.h b/src/gui/opengl/platform/egl/qt_egl_p.h index 1f538e22af7..52ecdf3f8ec 100644 --- a/src/gui/opengl/platform/egl/qt_egl_p.h +++ b/src/gui/opengl/platform/egl/qt_egl_p.h @@ -43,6 +43,20 @@ #include #include +#ifndef QT_EGL_NO_X11 +#undef Status +#undef None +#undef Bool +#undef CursorShape +#undef KeyPress +#undef KeyRelease +#undef FocusIn +#undef FocusOut +#undef FontChange +#undef Expose +#undef Unsorted +#endif + #include QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/eglfs/api/qeglfsglobal_p.h b/src/plugins/platforms/eglfs/api/qeglfsglobal_p.h index 488675dbf11..b702fb2ee9c 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsglobal_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfsglobal_p.h @@ -27,18 +27,6 @@ QT_BEGIN_NAMESPACE #define Q_EGLFS_EXPORT Q_DECL_IMPORT #endif -#undef Status -#undef None -#undef Bool -#undef CursorShape -#undef KeyPress -#undef KeyRelease -#undef FocusIn -#undef FocusOut -#undef FontChange -#undef Expose -#undef Unsorted - QT_END_NAMESPACE #endif