From patchwork Sun May 29 19:58:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 97849 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6C540B6F82 for ; Mon, 30 May 2011 05:59:10 +1000 (EST) Received: from localhost ([::1]:33836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQm8h-00037K-4Y for incoming@patchwork.ozlabs.org; Sun, 29 May 2011 15:59:07 -0400 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 Received: from smtp08.web.de ( [172.20.5.216]) by fmmailgate03.web.de (Postfix) with ESMTP id D35F918F962F0; Sun, 29 May 2011 21:58:52 +0200 (CEST) Received: from [87.173.127.118] (helo=af.local) by smtp08.web.de with asmtp (WEB.DE 4.110 #2) id 1QQm8S-0000YV-00; Sun, 29 May 2011 21:58:52 +0200 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sun, 29 May 2011 21:58:51 +0200 Message-Id: <1306699131-59195-1-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: References: MIME-Version: 1.0 X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX185ZIxXDWxS1Hyl47Z8SK32RtNvv5KcphXKnTak rkhXZsmpYkUPJL0D+V7wf86bMZ3elBkARY4rMMpafOC+lhvMgk x7E84spGycJV8KlRziaA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.234 Cc: Alexandre Raymond , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH] cocoa: Provide central qemu_main() prototype X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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ärber --- 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 +#include #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()); } } }