Patchwork Eliminates a warning about missing function prototype for qemu_main.

login
register
mail settings
Submitter G 3
Date Dec. 17, 2009, 3:45 a.m.
Message ID <B674B80C-A6A4-4181-AC4D-6B4AA26D89F5@gmail.com>
Download mbox | patch
Permalink /patch/41301/
State New
Headers show

Comments

G 3 - Dec. 17, 2009, 3:45 a.m.
This patch allows for the file vl.c to compile without any warnings.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>


---
  vl.c |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)
Juan Quintela - Dec. 17, 2009, 7:38 p.m.
G 3 <programmingkidx@gmail.com> wrote:
> This patch allows for the file vl.c to compile without any warnings.
>
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>
>
> ---
>  vl.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index c0d98f5..b466fe0 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -107,16 +107,19 @@ extern int madvise(caddr_t, size_t, int);
>  #ifdef CONFIG_SDL
>  #if defined(__APPLE__) || defined(main)
>  #include <SDL.h>
> -int qemu_main(int argc, char **argv, char **envp);
> +
>  int main(int argc, char **argv)
>  {
>      return qemu_main(argc, argv, NULL);

Now qemu_main() is not defined here.

>  }
> +
>  #undef main
>  #define main qemu_main
>  #endif
>  #endif /* CONFIG_SDL */
>
> +int qemu_main(int argc, char **argv, char **envp);
> +
>  #ifdef CONFIG_COCOA
>  #undef main
>  #define main qemu_main

I suppose that you are using cocoa but not sdl, right?

If so, better approach is to share the COCOA/SDL bits for apple, or just
replicate the qemu_main definition.

Later, Juan.

Patch

diff --git a/vl.c b/vl.c
index c0d98f5..b466fe0 100644
--- a/vl.c
+++ b/vl.c
@@ -107,16 +107,19 @@  extern int madvise(caddr_t, size_t, int);
  #ifdef CONFIG_SDL
  #if defined(__APPLE__) || defined(main)
  #include <SDL.h>
-int qemu_main(int argc, char **argv, char **envp);
+
  int main(int argc, char **argv)
  {
      return qemu_main(argc, argv, NULL);
  }
+
  #undef main
  #define main qemu_main
  #endif
  #endif /* CONFIG_SDL */

+int qemu_main(int argc, char **argv, char **envp);
+
  #ifdef CONFIG_COCOA
  #undef main
  #define main qemu_main