From: Filip Navara <filip.navara@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Make the SDL_main workaround more generic
Date: Tue, 23 Jun 2009 14:20:50 -0000 [thread overview]
Message-ID: <E1MJ6rh-00032Z-P4@lists.gnu.org> (raw)
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
reply other threads:[~2009-06-23 14:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1MJ6rh-00032Z-P4@lists.gnu.org \
--to=filip.navara@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).