Windows: Make a distinction between ANSI mainline and UTF-8 mainline.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
diff --git a/src/main/windows/SDL_windows_main.c b/src/main/windows/SDL_windows_main.c
index 69634a2..dc51dc0 100644
--- a/src/main/windows/SDL_windows_main.c
+++ b/src/main/windows/SDL_windows_main.c
@@ -110,15 +110,15 @@ OutOfMemory(void)
#if defined(_MSC_VER)
/* The VC++ compiler needs main/wmain defined */
-# define console_utf8_main main
+# define console_ansi_main main
# if UNICODE
# define console_wmain wmain
# endif
#endif
-/* This is where execution begins [console apps, ansi] */
-int
-console_utf8_main(int argc, char *argv[])
+/* WinMain, main, and wmain eventually call into here. */
+static int
+main_utf8(int argc, char *argv[])
{
SDL_SetMainReady();
@@ -126,6 +126,15 @@ console_utf8_main(int argc, char *argv[])
return SDL_main(argc, argv);
}
+/* This is where execution begins [console apps, ansi] */
+int
+console_ansi_main(int argc, char *argv[])
+{
+ /* !!! FIXME: are these in the system codepage? We need to convert to UTF-8. */
+ return main_utf8(argc, argv);
+}
+
+
#if UNICODE
/* This is where execution begins [console apps, unicode] */
int
@@ -138,7 +147,7 @@ console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
argv[i] = WIN_StringToUTF8(wargv[i]);
}
- return console_utf8_main(argc, argv);
+ return main_utf8(argc, argv);
}
#endif
@@ -170,7 +179,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
ParseCommandLine(cmdline, argv);
/* Run the main program */
- console_utf8_main(argc, argv);
+ main_utf8(argc, argv);
SDL_stack_free(argv);