[SDL] Re: cross-compiling woes

jimrandomh usenetNOSPAM at jimrandomh.org
Mon Jan 17 21:17:45 PST 2005


Paul Pelzl <pelzlpj at eecs.umich.edu> wrote:
> On Tue, Jan 18, 2005 at 02:00:05AM -0300, Gabriel wrote:
>> Your entry point is main(), right? I use something like this :
>> 
>> #ifdef WIN32
>> extern "C"
>> {
>> 
>> int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
>> char* lpCmdLine, int nCmdShow)
>> {
> ...
>>      // Do main
>>      int nRet = main(nParms + 1, pParms);
> ...
>> }
>> #endif
> 
> 
> OK, thanks, that does work.  But should this be necessary?  I thought
> SDL_main worked some magic to call the right entry point across all
> platforms.  And I didn't have any problems using main() with the
> precompiled mingw libraries provided on the SDL website.

I brought this up a few days ago. I'm of the opinion that stdio 
redirect is a bad idea entirely; it's awkward to disable, usually 
unexpected, often unwanted and clearly outside the natural scope of the 
SDL library. (Even for programs where it is reasonable to output to 
files instead of stdout, it's badly behaved; it creates the files even 
if there's nothing to put in them, cluttering up the filesystem.)

Would anyone object to a patch that added SDL_RedirectStdio() and 
removed the redirection from SDLmain?

-- 
CalcRogue: TI-89, TI-92+, PalmOS, Windows and Linux.
http://calcrogue.jimrandomh.org/





More information about the SDL mailing list