summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/osd/modules/netdev/pcap.c13
-rw-r--r--src/osd/modules/render/d3d/d3d9intf.c6
-rw-r--r--src/osd/windows/video.c2
3 files changed, 16 insertions, 5 deletions
diff --git a/src/osd/modules/netdev/pcap.c b/src/osd/modules/netdev/pcap.c
index 3e48aebb057..7cdb4673088 100644
--- a/src/osd/modules/netdev/pcap.c
+++ b/src/osd/modules/netdev/pcap.c
@@ -1,7 +1,13 @@
#if defined(OSD_NET_USE_PCAP)
#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS)
-
+#ifdef UNICODE
+#define LIB_NAME L"wpcap.dll"
+#define LoadDynamicLibrary LoadLibraryW
+#else
+#define LIB_NAME "wpcap.dll"
+#define LoadDynamicLibrary LoadLibraryA
+#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
@@ -15,7 +21,6 @@
#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS)
-#define LIB_NAME L"wpcap.dll"
#define LIB_ERROR_STR "Unable to load winpcap: %lx\n"
typedef DWORD except_type;
@@ -39,7 +44,7 @@ typedef const char *except_type;
#define FreeLibrary(x) dlclose(x)
#define GetLastError() dlerror()
#define GetProcAddress(x, y) dlsym(x, y)
-#define LoadLibrary(x) dlopen(x, RTLD_LAZY)
+#define LoadDynamicLibrary(x) dlopen(x, RTLD_LAZY)
#endif
@@ -239,7 +244,7 @@ bool pcap_module::probe()
{
if (handle == NULL)
{
- handle = LoadLibrary(LIB_NAME);
+ handle = LoadDynamicLibrary(LIB_NAME);
return (handle != NULL);
}
return true;
diff --git a/src/osd/modules/render/d3d/d3d9intf.c b/src/osd/modules/render/d3d/d3d9intf.c
index 951015004df..7a35d0ad577 100644
--- a/src/osd/modules/render/d3d/d3d9intf.c
+++ b/src/osd/modules/render/d3d/d3d9intf.c
@@ -101,9 +101,15 @@ base *drawd3d9_init(void)
HINSTANCE fxhandle = NULL;
for (int idx = 99; idx >= 0; idx--) // a shameful moogle
{
+ #ifdef UNICODE
wchar_t dllbuf[13];
wsprintf(dllbuf, TEXT("d3dx9_%d.dll"), idx);
fxhandle = LoadLibrary(dllbuf);
+ #else
+ char dllbuf[13];
+ sprintf(dllbuf, "d3dx9_%d.dll", idx);
+ fxhandle = LoadLibraryA(dllbuf);
+ #endif
if (fxhandle != NULL)
{
break;
diff --git a/src/osd/windows/video.c b/src/osd/windows/video.c
index d12ba3dcebd..3bfefee7270 100644
--- a/src/osd/windows/video.c
+++ b/src/osd/windows/video.c
@@ -228,7 +228,7 @@ BOOL CALLBACK win_monitor_info::monitor_enum_callback(HMONITOR handle, HDC dc, L
float aspect = (float)(info.rcMonitor.right - info.rcMonitor.left) / (float)(info.rcMonitor.bottom - info.rcMonitor.top);
// allocate a new monitor info
- char *temp = utf8_from_wstring(info.szDevice);
+ char *temp = utf8_from_tstring(info.szDevice);
// copy in the data
monitor = global_alloc(win_monitor_info(handle, temp, aspect));
osd_free(temp);