summaryrefslogtreecommitdiffstats
path: root/console.h
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly+launchpad@gmail.com>2011-09-07 15:44:36 -0400
committerAnthony Liguori <aliguori@us.ibm.com>2011-09-09 12:58:16 -0500
commitdf00bed0fa30a6f5712456e7add783e470c534c9 (patch)
tree059a74bafa5d495988647ba3b4ef36d2b0bed684 /console.h
parent3b86b13ab07407fc8c6ac0efbd717fe51df1cad7 (diff)
downloadhqemu-df00bed0fa30a6f5712456e7add783e470c534c9.zip
hqemu-df00bed0fa30a6f5712456e7add783e470c534c9.tar.gz
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 <djpohly+launchpad@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'console.h')
-rw-r--r--console.h5
1 files changed, 5 insertions, 0 deletions
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 <curses.h>
+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))
OpenPOWER on IntegriCloud