qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Make the SDL_main workaround more generic


From: Filip Navara
Subject: [Qemu-devel] [PATCH] Make the SDL_main workaround more generic
Date: Tue, 23 Jun 2009 14:20:50 -0000

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 <address@hidden>
---
 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 <libvdeplug.h>
 #endif
 
+#ifdef CONFIG_SDL
+#include <SDL.h>
+#endif
+
 #ifdef _WIN32
 #include <windows.h>
 #include <mmsystem.h>
 #endif
 
-#ifdef CONFIG_SDL
-#if defined(__APPLE__) || defined(main)
-#include <SDL.h>
-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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]