All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Make the SDL_main workaround more generic
@ 2009-06-23 14:20 Filip Navara
  0 siblings, 0 replies; only message in thread
From: Filip Navara @ 2009-06-23 14:20 UTC (permalink / raw)
  To: qemu-devel

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 <filip.navara@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-23 14:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-23 14:20 [Qemu-devel] [PATCH] Make the SDL_main workaround more generic Filip Navara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.