Received: from eggs.gnu.org ([2001:4830:134:3::10]:58972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnYUn-00026L-6p for qemu-devel@nongnu.org; Fri, 14 Jun 2013 14:13:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnYUh-0001Ho-Vz for qemu-devel@nongnu.org; Fri, 14 Jun 2013 14:13:09 -0400 Received: from co1ehsobe005.messaging.microsoft.com ([216.32.180.188]:49705 helo=co1outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnYUh-0001HW-Ne for qemu-devel@nongnu.org; Fri, 14 Jun 2013 14:13:03 -0400 From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= Date: Fri, 14 Jun 2013 20:12:28 +0200 Message-ID: <1371233548-19925-1-git-send-email-vincent.stehle@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] vl: fix compilation without SDL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , =?UTF-8?q?Vincent=20Stehl=C3=A9?= Fix the following error, which happens when CONFIG_SDL is not defined: vl.c: In function =E2=80=98main=E2=80=99: vl.c:3528:17: error: =E2=80=98no_frame=E2=80=99 undeclared (first use i= n this function) vl.c:3528:17: note: each undeclared identifier is reported only once fo= r each function it appears in Protect code accessing no_frame and while at it, protect even more code r= elated to alt_grab and ctrl_grab. Signed-off-by: Vincent Stehl=C3=A9 Cc: Anthony Liguori --- vl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 9f8fd6e..67de399 100644 --- a/vl.c +++ b/vl.c @@ -229,8 +229,10 @@ int nb_option_roms; int semihosting_enabled =3D 0; int old_param =3D 0; const char *qemu_name; +#ifdef CONFIG_SDL int alt_grab =3D 0; int ctrl_grab =3D 0; +#endif unsigned int nb_prom_envs =3D 0; const char *prom_envs[MAX_PROM_ENVS]; int boot_menu; @@ -3524,6 +3526,7 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_full_screen: full_screen =3D 1; break; +#ifdef CONFIG_SDL case QEMU_OPTION_no_frame: no_frame =3D 1; break; @@ -3533,6 +3536,7 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_ctrl_grab: ctrl_grab =3D 1; break; +#endif case QEMU_OPTION_no_quit: no_quit =3D 1; break; @@ -4080,11 +4084,12 @@ int main(int argc, char **argv, char **envp) display_type =3D DT_NONE; #endif } - +#ifdef CONFIG_SDL if ((no_frame || alt_grab || ctrl_grab) && display_type !=3D DT_SDL)= { fprintf(stderr, "-no-frame, -alt-grab and -ctrl-grab are only va= lid " "for SDL, ignoring option\n"); } +#endif if (no_quit && (display_type !=3D DT_GTK && display_type !=3D DT_SDL= )) { fprintf(stderr, "-no-quit is only valid for GTK and SDL, " "ignoring option\n"); --=20 1.7.10.4