From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHN6z-0008DD-TB for qemu-devel@nongnu.org; Thu, 18 Jun 2009 15:17:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHN6v-00081s-55 for qemu-devel@nongnu.org; Thu, 18 Jun 2009 15:17:25 -0400 Received: from [199.232.76.173] (port=50247 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHN6v-00081g-2Y for qemu-devel@nongnu.org; Thu, 18 Jun 2009 15:17:21 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:52425) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHN6u-0002YL-E2 for qemu-devel@nongnu.org; Thu, 18 Jun 2009 15:17:20 -0400 Message-ID: <4A3A92BD.2080708@mail.berlios.de> Date: Thu, 18 Jun 2009 21:17:17 +0200 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Win32: Fix compilation with SDL. References: <1245348663-9022-1-git-send-email-weil@mail.berlios.de> <4A3A8B77.2020109@codemonkey.ws> <4A3A8F22.2080907@mail.berlios.de> <4A3A91A5.4080209@codemonkey.ws> In-Reply-To: <4A3A91A5.4080209@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: QEMU Developers 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