summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-01-16 05:55:15 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-01-16 05:55:15 +0000
commit1c38c3eb871e49d4cdf39284b0d84a8363a18bb4 (patch)
treea998e01ce55a563a0bf6df36cd6790b94d99e73e
parentc6d4f5faa856facd2721abb6882118e6b9a706b9 (diff)
Fix SDL Win32 build to build as unicode.mame0136u1
-rw-r--r--src/osd/sdl/main.c3
-rw-r--r--src/osd/sdl/sdl.mak4
-rw-r--r--src/osd/sdl/sdlos_win32.c2
-rw-r--r--src/osd/sdl/video.c10
4 files changed, 14 insertions, 5 deletions
diff --git a/src/osd/sdl/main.c b/src/osd/sdl/main.c
index 1e047108306..d6a7b3bc139 100644
--- a/src/osd/sdl/main.c
+++ b/src/osd/sdl/main.c
@@ -32,8 +32,7 @@ extern int utf8_main(int argc, char *argv[]);
#undef wmain
#endif
-//extern "C" int _tmain(int argc, TCHAR **argv)
-int main(int argc, TCHAR **argv)
+extern "C" int _tmain(int argc, TCHAR **argv)
{
int i, rc;
char **utf8_argv;
diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak
index ccec6f91edb..123a30f5e26 100644
--- a/src/osd/sdl/sdl.mak
+++ b/src/osd/sdl/sdl.mak
@@ -333,6 +333,10 @@ OSDCOREOBJS += $(SDLOBJ)/main.o
SDLMAIN = $(SDLOBJ)/main.o
DEFS += -Dmain=utf8_main
+# enable UNICODE flags
+DEFS += -DUNICODE -D_UNICODE
+LDFLAGS += -municode
+
# at least compile some stubs to link it
OSDCOREOBJS += $(SDLOBJ)/debugwin.o
diff --git a/src/osd/sdl/sdlos_win32.c b/src/osd/sdl/sdlos_win32.c
index 789f816ca7f..3d5c7192740 100644
--- a/src/osd/sdl/sdlos_win32.c
+++ b/src/osd/sdl/sdlos_win32.c
@@ -271,7 +271,7 @@ void osd_break_into_debugger(const char *message)
{
if (IsDebuggerPresent())
{
- OutputDebugString(message);
+ OutputDebugStringA(message);
DebugBreak();
}
}
diff --git a/src/osd/sdl/video.c b/src/osd/sdl/video.c
index 97d360dbb64..09378e8f98c 100644
--- a/src/osd/sdl/video.c
+++ b/src/osd/sdl/video.c
@@ -32,6 +32,8 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+
+#include "strconv.h"
#endif
#ifdef SDLMAME_OS2
@@ -193,7 +195,9 @@ void sdlvideo_monitor_refresh(sdl_monitor_info *monitor)
GetMonitorInfo((HMONITOR)monitor->handle, (LPMONITORINFO)&info);
monitor->center_width = monitor->monitor_width = info.rcMonitor.right - info.rcMonitor.left;
monitor->center_height = monitor->monitor_height = info.rcMonitor.bottom - info.rcMonitor.top;
- strcpy(monitor->monitor_device, info.szDevice);
+ char *temp = utf8_from_wstring(info.szDevice);
+ strcpy(monitor->monitor_device, temp);
+ free(temp);
#elif defined(SDLMAME_MACOSX) // Mac OS X Core Imaging version
CGDirectDisplayID primary;
CGRect dbounds;
@@ -420,7 +424,9 @@ static BOOL CALLBACK monitor_enum_callback(HMONITOR handle, HDC dc, LPRECT rect,
#endif
monitor->monitor_width = info.rcMonitor.right - info.rcMonitor.left;
monitor->monitor_height = info.rcMonitor.bottom - info.rcMonitor.top;
- strcpy(monitor->monitor_device, info.szDevice);
+ char *temp = utf8_from_wstring(info.szDevice);
+ strcpy(monitor->monitor_device, temp);
+ free(temp);
// guess the aspect ratio assuming square pixels
monitor->aspect = (float)(info.rcMonitor.right - info.rcMonitor.left) / (float)(info.rcMonitor.bottom - info.rcMonitor.top);