All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Win32: Fix compilation with SDL.
Date: Thu, 18 Jun 2009 21:17:17 +0200	[thread overview]
Message-ID: <4A3A92BD.2080708@mail.berlios.de> (raw)
In-Reply-To: <4A3A91A5.4080209@codemonkey.ws>

Anthony Liguori schrieb:
> Stefan Weil wrote:
>> Anthony Liguori schrieb:
>>  
>>> Stefan Weil wrote:
>>>    
>>>> `sdl-config --cflags` defines main = SDL_main
>>>> on some platforms. One of these platforms is
>>>> Windows with mingw32.
>>>>         
>>> How about adding -Umain to SDL_CFLAGS on _WIN32 and and __APPLE__?
>>>
>>> Regards,
>>>
>>> Anthony Liguori
>>>
>>>     
>>
>> I think -Dmain=SDL_main was added to the SDL CFLAGS because
>> the SDL implementation needs some special startup code.
>> Redefining main (or directly using the correct name) is typical
>> for windows gui applications.
>>
>> -Umain would destroy this mechanism and create an executable
>> which won't run in the worst case.
>>   
>
> Why do we need to do anything special then?
>
> I don't understand what the point of the qemu_main stuff is.
>
> Regards,
>
> Anthony Liguori
>

Ah, ok: it's simply a bad prototype of SDL_config:

extern C_LINKAGE int SDL_main(int argc, char *argv[]);

QEMU's main does not match:
int main(int argc, char **argv, char **envp)

So just redefining main will result in a wrong SDL_main
with 3 instead of 2 arguments.

Regards,
Stefan Weil

  reply	other threads:[~2009-06-18 19:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-18 18:11 [Qemu-devel] [PATCH] Win32: Fix compilation with SDL Stefan Weil
2009-06-18 18:46 ` Anthony Liguori
2009-06-18 19:01   ` Stefan Weil
2009-06-18 19:12     ` Anthony Liguori
2009-06-18 19:17       ` Stefan Weil [this message]
2009-06-18 20:00         ` Anthony Liguori
2009-06-18 20:49           ` Hollis Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A3A92BD.2080708@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.