[03/12] stubs: curses_display_init() stub
diff mbox

Message ID 1447268956-27500-4-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost Nov. 11, 2015, 7:09 p.m. UTC
One less #ifdef in vl.c.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 stubs/Makefile.objs |  1 +
 stubs/curses.c      | 10 ++++++++++
 vl.c                |  2 --
 3 files changed, 11 insertions(+), 2 deletions(-)
 create mode 100644 stubs/curses.c

Patch
diff mbox

diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index f69ab8d..df86bc6 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -38,3 +38,4 @@  stub-obj-y += qmp_pc_dimm_device_list.o
 stub-obj-y += target-monitor-defs.o
 stub-obj-y += vhost.o
 stub-obj-y += vnc.o
+stub-obj-y += curses.o
diff --git a/stubs/curses.c b/stubs/curses.c
new file mode 100644
index 0000000..2115c77
--- /dev/null
+++ b/stubs/curses.c
@@ -0,0 +1,10 @@ 
+#include "qemu-common.h"
+#include "ui/console.h"
+#include "qemu/error-report.h"
+
+void curses_display_init(DisplayState *ds, int full_screen)
+{
+    /* This must never be called if CONFIG_CURSES is disabled */
+    error_report("curses support is disabled");
+    abort();
+}
diff --git a/vl.c b/vl.c
index 0558e87..3ca1c11 100644
--- a/vl.c
+++ b/vl.c
@@ -4568,11 +4568,9 @@  int main(int argc, char **argv, char **envp)
     case DT_NOGRAPHIC:
         (void)ds;	/* avoid warning if no display is configured */
         break;
-#if defined(CONFIG_CURSES)
     case DT_CURSES:
         curses_display_init(ds, full_screen);
         break;
-#endif
 #if defined(CONFIG_SDL)
     case DT_SDL:
         sdl_display_init(ds, full_screen, no_frame);