summaryrefslogtreecommitdiffstats
path: root/softmmu
diff options
context:
space:
mode:
authorMarc-André Lureau2022-04-20 15:25:47 +0200
committerMarc-André Lureau2022-04-21 14:56:55 +0200
commit88c39c8693f2b7f0a9fbac1cdd9496493066563a (patch)
treec5cf9edf2bc6d544f0d1aed02fc5beae18f35a86 /softmmu
parentscripts/analyze-inclusions: drop qemu-common.h from analysis (diff)
downloadqemu-88c39c8693f2b7f0a9fbac1cdd9496493066563a.tar.gz
qemu-88c39c8693f2b7f0a9fbac1cdd9496493066563a.tar.xz
qemu-88c39c8693f2b7f0a9fbac1cdd9496493066563a.zip
Simplify softmmu/main.c
Move qemu_main() declaration to a new header. Simplify main.c since both cocoa & sdl cannot be enabled together. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-5-marcandre.lureau@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/main.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/softmmu/main.c b/softmmu/main.c
index 639c67ff48..c00432ff09 100644
--- a/softmmu/main.c
+++ b/softmmu/main.c
@@ -23,28 +23,14 @@
*/
#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qemu-main.h"
#include "sysemu/sysemu.h"
#ifdef CONFIG_SDL
-#if defined(__APPLE__) || defined(main)
#include <SDL.h>
-static 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
-#endif /* CONFIG_COCOA */
-int main(int argc, char **argv, char **envp)
+int qemu_main(int argc, char **argv, char **envp)
{
qemu_init(argc, argv, envp);
qemu_main_loop();
@@ -52,3 +38,10 @@ int main(int argc, char **argv, char **envp)
return 0;
}
+
+#ifndef CONFIG_COCOA
+int main(int argc, char **argv)
+{
+ return qemu_main(argc, argv, NULL);
+}
+#endif