[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-2.8] curses: Fix compiler warnings (Mingw-w64 re
[Qemu-devel] [PATCH for-2.8] curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT)
Sat, 19 Nov 2016 19:53:18 +0100
For builds with Mingw-w64 as it is included in Cygwin, there are two
header files which define KEY_EVENT with different values.
This results in lots of compiler warnings like this one:
In file included from /qemu/include/ui/console.h:340:0,
#define KEY_EVENT 0633 /* We were interrupted by an event */
In file included from /usr/share/mingw-w64/include/windows.h:74:0,
/usr/share/mingw-w64/include/wincon.h:101:0: note: this is the location of the
#define KEY_EVENT 0x1
QEMU only uses the KEY_EVENT macro from wincon.h.
Therefore we can undefine the macro coming from curses.h.
The explicit include statement for curses.h in ui/curses.c is not needed
and was removed.
Those two modifications fix the redefinition warnings.
Signed-off-by: Stefan Weil <address@hidden>
include/ui/console.h | 3 +++
ui/curses.c | 1 -
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/ui/console.h b/include/ui/console.h
index e2589e2..e5ae506 100644
@@ -337,7 +337,10 @@ static inline pixman_format_code_t
+/* KEY_EVENT is defined in wincon.h and in curses.h. Avoid redefinition. */
typedef chtype console_ch_t;
extern chtype vga_to_curses;
diff --git a/ui/curses.c b/ui/curses.c
index 2e132a7..03cefdf 100644
@@ -22,7 +22,6 @@
* THE SOFTWARE.
- [Qemu-devel] [PATCH for-2.8] curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT),
Stefan Weil <=