qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Win32: Fix compilation with SDL.


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] Win32: Fix compilation with SDL.
Date: Thu, 18 Jun 2009 21:17:17 +0200
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]