From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQm8V-00037C-Jj for qemu-devel@nongnu.org; Sun, 29 May 2011 15:58:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQm8U-0000Im-MA for qemu-devel@nongnu.org; Sun, 29 May 2011 15:58:55 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:58262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQm8U-0000Ic-BU for qemu-devel@nongnu.org; Sun, 29 May 2011 15:58:54 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 29 May 2011 21:58:51 +0200 Message-Id: <1306699131-59195-1-git-send-email-andreas.faerber@web.de> In-Reply-To: References: 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] 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 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) =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 1ff1ac6..6566e46 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 @@ -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()); } } } --=20 1.7.5.3