Patchwork [4/6] Fix missing prototype under cocoa for qemu_main

login
register
mail settings
Submitter Alexandre Raymond
Date May 27, 2011, 5:22 p.m.
Message ID <1306516951-31105-5-git-send-email-cerbere@gmail.com>
Download mbox | patch
Permalink /patch/97726/
State New
Headers show

Comments

Alexandre Raymond - May 27, 2011, 5:22 p.m.
The following error message was encountered when compiling
with cocoa support because qemu_main did not have a prototype.

-----8<-----
qemu/vl.c:2037: warning: no previous prototype for ‘qemu_main’
-----8<-----

Add its prototype in the COCOA ifdef, similar to what is done for SDL.

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
---
 vl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Andreas Färber - May 29, 2011, 3:11 p.m.
Am 27.05.2011 um 19:22 schrieb Alexandre Raymond:

> The following error message was encountered when compiling
> with cocoa support because qemu_main did not have a prototype.
>
> -----8<-----
> qemu/vl.c:2037: warning: no previous prototype for ‘qemu_main’
> -----8<-----
>
> Add its prototype in the COCOA ifdef, similar to what is done for SDL.
>
> Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
> ---
> vl.c |    1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index b362871..b983646 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -107,6 +107,7 @@ int main(int argc, char **argv)
> #endif /* CONFIG_SDL */
>
> #ifdef CONFIG_COCOA
> +int qemu_main(int argc, char **argv, char **envp);
> #undef main
> #define main qemu_main
> #endif /* CONFIG_COCOA */

We've seen at least two different ways of fixing this.

I believe my last one was forgotten, waiting for someone to test with  
SDL. The idea was to have the prototype in a header shared between  
vl.c and cocoa.m, so that we don't have to duplicate the prototype.  
I'll see if I can dig it out or will post a new patch.

Andreas

Patch

diff --git a/vl.c b/vl.c
index b362871..b983646 100644
--- a/vl.c
+++ b/vl.c
@@ -107,6 +107,7 @@  int main(int argc, char **argv)
 #endif /* CONFIG_SDL */
 
 #ifdef CONFIG_COCOA
+int qemu_main(int argc, char **argv, char **envp);
 #undef main
 #define main qemu_main
 #endif /* CONFIG_COCOA */