Просмотр исходного кода

qt: Avoid X11 / QT symbols clashing

The X11 library defines into the X11/X.h include file the following symbols by means of #define:

- CursorShape
- Bool
- Status
- None
- KeyPress
- KeyRelease
- FocusIn
- FocusOut
- FontChange
- Expose
(and more)

The same symbols are also used by Qt library (see qt5/QtCore/qcoreevent.h incldue file) and including X11 files before Qt includes will generate a lot of symbol name collisions with strange compiler
errors like:

/usr/include/qt5/QtCore/qcoreevent.h:63:9: error: expected identifier before numeric constant
         None = 0,                               // invalid event
         ^

To solve this kind of issue we must #undef all clashing X11 symbols before to include Qt files.

Plex-CLA-1.0-signed-off-by: Luigi Mantellini <luigi.mantellini@gmail.com>
Luigi 'Comio' Mantellini 6 лет назад
Родитель
Сommit
61262d570b
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      src/display/x11/DisplayManagerX11.h

+ 7 - 0
src/display/x11/DisplayManagerX11.h

@@ -9,6 +9,13 @@
 #undef CursorShape
 #undef Bool
 #undef Status
+#undef None
+#undef KeyPress
+#undef KeyRelease
+#undef FocusIn
+#undef FocusOut
+#undef FontChange
+#undef Expose
 
 #include "display/DisplayManager.h"