author Ryan C. Gordon <>
Mon, 29 Oct 2018 20:00:03 -0400
changeset 12369 68c87b40b434
parent 7856 cb37776926ad
permissions -rw-r--r--
winmain: Don't use SDL_malloc (or SDL_stack_alloc, which might be malloc).

Otherwise, we are using the allocator before the app can set up its own hooks.

Now we use VirtualAlloc, and WideCharToMultiByte (because SDL_iconv uses
SDL_malloc, too!) to get ready to call into SDL_main.

This also makes console_wmain() call into the same routines as everything
else, so we don't have to deal with those allocations, too. Hopefully we
end up with the same results from GetCommandLine() as we do in wargv.

Fixes Bugzilla #4340.
     1 Future work roadmap:
     2  *
     4  * Check 1.2 revisions:
     5 	3554 - Need to resolve semantics for locking keys on different platforms
     6 	4874 - Do we want screen rotation?  At what level?
     7 	4974 - Windows file code needs to convert UTF-8 to Unicode, but we don't need to tap dance for Windows 95/98
     8 	4865 - See if this is still needed (mouse coordinate clamping)
     9 	4866 - See if this is still needed (blocking window repositioning)