summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-04-03 17:30:37 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-04-03 17:55:10 +0200
commitd8aa889edf4d47ebd31aadbb54707986fdf68166 (patch)
tree672cf4287d26e53c79e2ee03aab5f2ea29d90a67
parente49f3ccb97755a11685b601c741c9981da83336c (diff)
merge main.cpp for windows platform (unicode) (nw)
-rw-r--r--scripts/src/osd/sdl.lua2
-rw-r--r--src/osd/sdl/main.cpp61
-rw-r--r--src/osd/windows/main.cpp15
3 files changed, 6 insertions, 72 deletions
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index 00d219f2229..d9e62fb04f3 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -368,7 +368,7 @@ project ("osd_" .. _OPTIONS["osd"])
if _OPTIONS["targetos"]=="windows" then
files {
- MAME_DIR .. "src/osd/sdl/main.cpp",
+ MAME_DIR .. "src/osd/windows/main.cpp",
}
end
diff --git a/src/osd/sdl/main.cpp b/src/osd/sdl/main.cpp
deleted file mode 100644
index 7a73e6a82a9..00000000000
--- a/src/osd/sdl/main.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Aaron Giles
-//============================================================
-//
-// main.c - Win32 main program
-//
-//============================================================
-
-// standard windows headers
-#ifdef OSD_SDL
-#define _WIN32_WINNT 0x0400
-#endif
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <tchar.h>
-#include <stdlib.h>
-
-// MAMEOS headers
-#include "strconv.h"
-
-extern int utf8_main(int argc, char *argv[]);
-
-
-
-//============================================================
-// main
-//============================================================
-
-// undo the command-line #define that maps main to utf8_main in all other cases
-#ifndef WINUI
-#undef main
-#undef wmain
-#endif
-#ifdef UNICODE
-extern "C" int _tmain(int argc, TCHAR **argv)
-{
- int i, rc;
- char **utf8_argv;
-
- /* convert arguments to UTF-8 */
- utf8_argv = (char **) malloc(argc * sizeof(*argv));
- if (utf8_argv == NULL)
- return 999;
- for (i = 0; i < argc; i++)
- {
- utf8_argv[i] = utf8_from_tstring(argv[i]);
- if (utf8_argv[i] == NULL)
- return 999;
- }
-
- /* run utf8_main */
- rc = utf8_main(argc, utf8_argv);
-
- /* free arguments */
- for (i = 0; i < argc; i++)
- osd_free(utf8_argv[i]);
- free(utf8_argv);
-
- return rc;
-}
-#endif
diff --git a/src/osd/windows/main.cpp b/src/osd/windows/main.cpp
index ccfddb27a0d..4ef0baf1c98 100644
--- a/src/osd/windows/main.cpp
+++ b/src/osd/windows/main.cpp
@@ -7,28 +7,22 @@
//============================================================
// standard windows headers
+#ifdef OSD_SDL
+#define _WIN32_WINNT 0x0501
+#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#include <stdlib.h>
-// MAMEOS headers
#include "strconv.h"
extern int utf8_main(int argc, char *argv[]);
-
-
-
//============================================================
// main
//============================================================
-// undo the command-line #define that maps main to utf8_main in all other cases
-#ifndef WINUI
-#undef main
-#undef wmain
-#endif
-
+#ifdef UNICODE
extern "C" int _tmain(int argc, TCHAR **argv)
{
int i, rc;
@@ -55,3 +49,4 @@ extern "C" int _tmain(int argc, TCHAR **argv)
return rc;
}
+#endif