We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3579 - SDL_main seems not working and not-using on MinGW (non-w64).
Summary: SDL_main seems not working and not-using on MinGW (non-w64).
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: main (show other bugs)
Version: HG 2.1
Hardware: x86 Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-02 09:06 UTC by Vitaly Novichkov
Modified: 2017-02-02 09:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly Novichkov 2017-02-02 09:06:18 UTC
Because SDL_main doesn't works on MinGW (MinGW itself uses generic main or ANSI-based WinMain).

Myself I implemented the thing which will 100% give UTF8 into the main() function:
https://github.com/WohlSoft/PGE-Project/tree/master/_common/Utf8Main

I just ignoring all arguments of WinMain, and taking command line by GetCommandLineW(), then splitting it into separated arguments by CommandLineToArgvW call and then converting each argument into UTF-8 to store into separated array which will be sent into regular main function.

Also, my reply is: if you have no UNICODE macro, just don't use WinMain's arguments and get them by GetCommandLineW() call, split and convert into UTF8.