From patchwork Wed Nov 11 19:09:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 543035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 702141402D4 for ; Thu, 12 Nov 2015 06:11:22 +1100 (AEDT) Received: from localhost ([::1]:42505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwang-0003aG-8Y for incoming@patchwork.ozlabs.org; Wed, 11 Nov 2015 14:11:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwan4-0002Mu-LZ for qemu-devel@nongnu.org; Wed, 11 Nov 2015 14:10:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwan3-0006bi-Fg for qemu-devel@nongnu.org; Wed, 11 Nov 2015 14:10:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwan3-0006bH-75 for qemu-devel@nongnu.org; Wed, 11 Nov 2015 14:10:41 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id CB2444F93F for ; Wed, 11 Nov 2015 19:10:40 +0000 (UTC) Received: from localhost (ovpn-113-50.phx2.redhat.com [10.3.113.50]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tABJAdSk019326; Wed, 11 Nov 2015 14:10:40 -0500 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 11 Nov 2015 17:09:08 -0200 Message-Id: <1447268956-27500-5-git-send-email-ehabkost@redhat.com> In-Reply-To: <1447268956-27500-1-git-send-email-ehabkost@redhat.com> References: <1447268956-27500-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini Subject: [Qemu-devel] [PATCH 04/12] stubs: SDL initialization stubs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This reduces the number of CONFIG_SDL #ifdefs in vl.c. Signed-off-by: Eduardo Habkost --- stubs/Makefile.objs | 1 + stubs/sdl.c | 17 +++++++++++++++++ vl.c | 6 ++---- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 stubs/sdl.c diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index df86bc6..3a6cd37 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -39,3 +39,4 @@ stub-obj-y += target-monitor-defs.o stub-obj-y += vhost.o stub-obj-y += vnc.o stub-obj-y += curses.o +stub-obj-y += sdl.o diff --git a/stubs/sdl.c b/stubs/sdl.c new file mode 100644 index 0000000..f5ab668 --- /dev/null +++ b/stubs/sdl.c @@ -0,0 +1,17 @@ +#include "qemu-common.h" +#include "ui/console.h" +#include "qemu/error-report.h" + +void sdl_display_early_init(int opengl) +{ + /* This must never be called if CONFIG_SDL is disabled */ + error_report("SDL support is disabled"); + abort(); +} + +void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) +{ + /* This must never be called if CONFIG_SDL is disabled */ + error_report("SDL support is disabled"); + abort(); +} diff --git a/vl.c b/vl.c index 3ca1c11..5292648 100644 --- a/vl.c +++ b/vl.c @@ -4261,11 +4261,10 @@ int main(int argc, char **argv, char **envp) early_gtk_display_init(request_opengl); } #endif -#if defined(CONFIG_SDL) if (display_type == DT_SDL) { sdl_display_early_init(request_opengl); } -#endif + if (request_opengl == 1 && display_opengl == 0) { #if defined(CONFIG_OPENGL) error_report("OpenGL is not supported by the display"); @@ -4571,11 +4570,10 @@ int main(int argc, char **argv, char **envp) case DT_CURSES: curses_display_init(ds, full_screen); break; -#if defined(CONFIG_SDL) case DT_SDL: sdl_display_init(ds, full_screen, no_frame); break; -#elif defined(CONFIG_COCOA) +#if defined(CONFIG_COCOA) case DT_COCOA: cocoa_display_init(ds, full_screen); break;