From: "Andreas Färber" <andreas.faerber@web.de>
To: qemu-devel@nongnu.org
Cc: "Alexandre Raymond" <cerbere@gmail.com>,
"Andreas Färber" <andreas.faerber@web.de>
Subject: [Qemu-devel] [PATCH] cocoa: Provide central qemu_main() prototype
Date: Sun, 29 May 2011 21:58:51 +0200 [thread overview]
Message-ID: <1306699131-59195-1-git-send-email-andreas.faerber@web.de> (raw)
In-Reply-To: <FB7E4CC1-F865-4AF5-9264-11A817D3F456@web.de>
This fixes a missing prototype warning in vl.c and obsoletes
the prototype in cocoa.m. Adjust callers in cocoa.m to supply
third argument, which is currently only used on Linux/ppc.
The prototype is designed so that it could be shared with SDL
and other frontends, if desired.
Cc: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
qemu-common.h | 5 +++++
ui/cocoa.m | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/qemu-common.h b/qemu-common.h
index b851b20..218289c 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -131,6 +131,11 @@ static inline char *realpath(const char *path, char *resolved_path)
#endif /* !defined(NEED_CPU_H) */
+/* main function, renamed */
+#if defined(CONFIG_COCOA)
+int qemu_main(int argc, char **argv, char **envp);
+#endif
+
/* bottom halves */
typedef void QEMUBHFunc(void *opaque);
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 1ff1ac6..6566e46 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -23,6 +23,7 @@
*/
#import <Cocoa/Cocoa.h>
+#include <crt_externs.h>
#include "qemu-common.h"
#include "console.h"
@@ -61,7 +62,6 @@ typedef struct {
int bitsPerPixel;
} QEMUScreen;
-int qemu_main(int argc, char **argv); // main defined in qemu/vl.c
NSWindow *normalWindow;
id cocoaView;
static DisplayChangeListener *dcl;
@@ -794,7 +794,7 @@ static int cocoa_keycode_to_qemu(int keycode)
COCOA_DEBUG("QemuCocoaAppController: startEmulationWithArgc\n");
int status;
- status = qemu_main(argc, argv);
+ status = qemu_main(argc, argv, *_NSGetEnviron());
exit(status);
}
@@ -876,7 +876,7 @@ int main (int argc, const char * argv[]) {
!strcmp(opt, "-nographic") ||
!strcmp(opt, "-version") ||
!strcmp(opt, "-curses")) {
- return qemu_main(gArgc, gArgv);
+ return qemu_main(gArgc, gArgv, *_NSGetEnviron());
}
}
}
--
1.7.5.3
next prev parent reply other threads:[~2011-05-29 19:58 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-27 17:22 [Qemu-devel] [PATCH 0/6] Fix compilation issues under darwin Alexandre Raymond
2011-05-27 17:22 ` [Qemu-devel] [PATCH 1/6] Fix incorrect check for fdatasync() in configure Alexandre Raymond
2011-05-29 14:50 ` Andreas Färber
2011-05-29 15:46 ` Alexandre Raymond
2011-05-29 17:05 ` Andreas Färber
2011-05-27 17:22 ` [Qemu-devel] [PATCH 2/6] Cocoa: avoid displaying window when command-line contains '-h' Alexandre Raymond
2011-05-28 15:05 ` Andreas Färber
2011-05-27 17:22 ` [Qemu-devel] [PATCH 3/6] Fix compilation warning due to incorrectly specified type Alexandre Raymond
2011-05-27 17:42 ` Stefan Weil
2011-05-29 15:02 ` Andreas Färber
2011-05-27 17:22 ` [Qemu-devel] [PATCH 4/6] Fix missing prototype under cocoa for qemu_main Alexandre Raymond
2011-05-29 15:11 ` Andreas Färber
2011-05-29 19:58 ` Andreas Färber [this message]
2011-05-29 23:53 ` [Qemu-devel] [PATCH] cocoa: Provide central qemu_main() prototype Alexandre Raymond
2011-06-02 11:33 ` Andreas Färber
2011-06-09 18:30 ` Andreas Färber
2011-05-27 17:22 ` [Qemu-devel] [PATCH 5/6] Remove warning in printf due to type mismatch Alexandre Raymond
2011-05-27 17:35 ` Stefan Weil
2011-05-27 19:11 ` Markus Armbruster
2011-05-27 20:44 ` Stefan Weil
2011-05-27 22:10 ` Alexandre Raymond
2011-05-28 6:55 ` Paolo Bonzini
2011-05-28 8:19 ` Stefan Weil
2011-05-27 17:22 ` [Qemu-devel] [PATCH 6/6] Avoid compilation warning regarding kvm under darwin Alexandre Raymond
2011-05-27 17:39 ` Stefan Weil
2011-05-28 14:55 ` [Qemu-devel] [PATCH 0/6] Fix compilation issues " Andreas Färber
2011-05-28 19:41 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
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=1306699131-59195-1-git-send-email-andreas.faerber@web.de \
--to=andreas.faerber@web.de \
--cc=cerbere@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).