From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJ6ri-00032v-Bd for qemu-devel@nongnu.org; Tue, 23 Jun 2009 10:20:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJ6rh-00032Z-P4 for qemu-devel@nongnu.org; Tue, 23 Jun 2009 10:20:49 -0400 Received: from [199.232.76.173] (port=59853 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJ6rh-00032T-Dg for qemu-devel@nongnu.org; Tue, 23 Jun 2009 10:20:49 -0400 Received: from a40-prg1-8-129.static.adsl.vol.cz ([88.146.54.129]:27391 helo=FilipNavara-PC) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MJ6rg-00052q-3x for qemu-devel@nongnu.org; Tue, 23 Jun 2009 10:20:49 -0400 From: Filip Navara Sender: Filip Navara MIME-Version: 1.0 Content-Type: text/plain; boundary=WC_MAIL_PaRt_BoUnDaRy_05151998 Message-Id: Subject: [Qemu-devel] [PATCH] Make the SDL_main workaround more generic List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 23 Jun 2009 14:20:50 -0000 To: qemu-devel@nongnu.org SDL 1.3 mostly removes the need for SDL_main on the mainstream platforms (including MacOS X and Win32). Current stable release requires it though, so support it properly for all the SDL platforms instead of just Win32 and MacOS X. Signed-off-by: Filip Navara --- vl.c | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/vl.c b/vl.c index 3a99ee0..7c98c14 100644 --- a/vl.c +++ b/vl.c @@ -103,24 +103,15 @@ #include #endif +#ifdef CONFIG_SDL +#include +#endif + #ifdef _WIN32 #include #include #endif -#ifdef CONFIG_SDL -#if defined(__APPLE__) || defined(main) -#include -int qemu_main(int argc, char **argv, char **envp); -int main(int argc, char **argv) -{ - return qemu_main(argc, argv, NULL); -} -#undef main -#define main qemu_main -#endif -#endif /* CONFIG_SDL */ - #ifdef CONFIG_COCOA #undef main #define main qemu_main @@ -4949,7 +4940,12 @@ char *qemu_find_file(int type, const char *name) return buf; } +/* SDL redefines the "main" function and requires a strict prototype */ +#ifdef main +int main(int argc, char **argv) +#else int main(int argc, char **argv, char **envp) +#endif { const char *gdbstub_dev = NULL; uint32_t boot_devices_bitmap = 0; @@ -4996,7 +4992,11 @@ int main(int argc, char **argv, char **envp) CPUState *env; int show_vnc_port = 0; +#ifdef main + qemu_cache_utils_init(NULL); +#else qemu_cache_utils_init(envp); +#endif LIST_INIT (&vm_change_state_head); #ifndef _WIN32 -- 1.6.3.msysgit.0