Skip to content

Commit

Permalink
Fixed bug 3320 - SDL_windows_main.c defines both console application …
Browse files Browse the repository at this point in the history
…entry points

Simon Hug

The SDLmain file src/main/windows/SDL_windows_main.c defines both entry points for console applications, main and wmain. This seems to confuse MSVC. It outputs a LNK4067 warning and then chooses main, which is a shame because only wmain has the unicode handling. Using SDLmain.lib provided on libsdl.org, the linker also goes for main.

I'm proposing to not define the main entry point at all. wmain should be supported well enough with MSVC.
  • Loading branch information
slouken committed Oct 1, 2016
1 parent 2cbe9e2 commit d870f27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/windows/SDL_windows_main.c
Expand Up @@ -110,9 +110,10 @@ OutOfMemory(void)

#if defined(_MSC_VER)
/* The VC++ compiler needs main/wmain defined */
# define console_ansi_main main
# if UNICODE
# define console_wmain wmain
# else
# define console_ansi_main main
# endif
#endif

Expand Down

0 comments on commit d870f27

Please sign in to comment.