From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWIKe-00086V-6k for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:22:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWIKa-0003fu-Hl for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:22:15 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:44726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWIKa-0003fc-1j for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:22:12 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 14 Jun 2011 03:22:04 +0200 Message-Id: <1308014527-60251-8-git-send-email-andreas.faerber@web.de> In-Reply-To: <1308014527-60251-7-git-send-email-andreas.faerber@web.de> References: <1308014527-60251-1-git-send-email-andreas.faerber@web.de> <1308014527-60251-2-git-send-email-andreas.faerber@web.de> <1308014527-60251-3-git-send-email-andreas.faerber@web.de> <1308014527-60251-4-git-send-email-andreas.faerber@web.de> <1308014527-60251-5-git-send-email-andreas.faerber@web.de> <1308014527-60251-6-git-send-email-andreas.faerber@web.de> <1308014527-60251-7-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: andreas.faerber@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 07/10] cocoa: Provide central qemu_main() prototype List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexandre Raymond , =?UTF-8?q?Andreas=20F=C3=A4rber?= 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 Signed-off-by: Andreas F=C3=A4rber --- 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 39fabc9..109498d 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -132,6 +132,11 @@ static inline char *realpath(const char *path, char = *resolved_path) =20 #endif /* !defined(NEED_CPU_H) */ =20 +/* main function, renamed */ +#if defined(CONFIG_COCOA) +int qemu_main(int argc, char **argv, char **envp); +#endif + /* bottom halves */ typedef void QEMUBHFunc(void *opaque); =20 diff --git a/ui/cocoa.m b/ui/cocoa.m index e1312d3..1c54759 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -23,6 +23,7 @@ */ =20 #import +#include =20 #include "qemu-common.h" #include "console.h" @@ -61,7 +62,6 @@ typedef struct { int bitsPerPixel; } QEMUScreen; =20 -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"); =20 int status; - status =3D qemu_main(argc, argv); + status =3D qemu_main(argc, argv, *_NSGetEnviron()); exit(status); } =20 @@ -877,7 +877,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()); } } } --=20 1.7.5.3