From df00bed0fa30a6f5712456e7add783e470c534c9 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Wed, 7 Sep 2011 15:44:36 -0400 Subject: curses: fix garbling when chtype != long Qemu currently assumes that chtype is typedef'd to unsigned long, but this is not necessarily the case (ncurses, for instance, can configure this at build-time). This patch uses the predefined chtype if qemu is configured for curses support and falls back to unsigned long otherwise. Fixes bug 568614. Signed-off-by: Devin J. Pohly Signed-off-by: Anthony Liguori --- console.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'console.h') diff --git a/console.h b/console.h index 67d1373..9c1487e 100644 --- a/console.h +++ b/console.h @@ -328,7 +328,12 @@ static inline int ds_get_bytes_per_pixel(DisplayState *ds) return ds->surface->pf.bytes_per_pixel; } +#ifdef CONFIG_CURSES +#include +typedef chtype console_ch_t; +#else typedef unsigned long console_ch_t; +#endif static inline void console_write_ch(console_ch_t *dest, uint32_t ch) { if (!(ch & 0xff)) -- cgit v1.1