Windows: Make a distinction between ANSI mainline and UTF-8 mainline.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 19 Feb 2015 21:49:15 -0500
changeset 9366 37c548184616
parent 9365 2e624f24d1af
child 9367 8acde42d7b81
Windows: Make a distinction between ANSI mainline and UTF-8 mainline.
src/main/windows/SDL_windows_main.c
--- a/src/main/windows/SDL_windows_main.c	Thu Feb 19 21:44:41 2015 -0500
+++ b/src/main/windows/SDL_windows_main.c	Thu Feb 19 21:49:15 2015 -0500
@@ -110,15 +110,15 @@
 
 #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 @@
     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 @@
         argv[i] = WIN_StringToUTF8(wargv[i]);
     }
 
-    return console_utf8_main(argc, argv);
+    return main_utf8(argc, argv);
 }
 #endif
 
@@ -170,7 +179,7 @@
     ParseCommandLine(cmdline, argv);
 
     /* Run the main program */
-    console_utf8_main(argc, argv);
+    main_utf8(argc, argv);
 
     SDL_stack_free(argv);