mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
Fixed non-unicode builds (nw)
This commit is contained in:
parent
1de80e729e
commit
1c61e69daf
@ -1,7 +1,13 @@
|
|||||||
#if defined(OSD_NET_USE_PCAP)
|
#if defined(OSD_NET_USE_PCAP)
|
||||||
|
|
||||||
#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS)
|
#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
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
@ -15,7 +21,6 @@
|
|||||||
|
|
||||||
#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS)
|
#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS)
|
||||||
|
|
||||||
#define LIB_NAME L"wpcap.dll"
|
|
||||||
#define LIB_ERROR_STR "Unable to load winpcap: %lx\n"
|
#define LIB_ERROR_STR "Unable to load winpcap: %lx\n"
|
||||||
typedef DWORD except_type;
|
typedef DWORD except_type;
|
||||||
|
|
||||||
@ -39,7 +44,7 @@ typedef const char *except_type;
|
|||||||
#define FreeLibrary(x) dlclose(x)
|
#define FreeLibrary(x) dlclose(x)
|
||||||
#define GetLastError() dlerror()
|
#define GetLastError() dlerror()
|
||||||
#define GetProcAddress(x, y) dlsym(x, y)
|
#define GetProcAddress(x, y) dlsym(x, y)
|
||||||
#define LoadLibrary(x) dlopen(x, RTLD_LAZY)
|
#define LoadDynamicLibrary(x) dlopen(x, RTLD_LAZY)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -239,7 +244,7 @@ bool pcap_module::probe()
|
|||||||
{
|
{
|
||||||
if (handle == NULL)
|
if (handle == NULL)
|
||||||
{
|
{
|
||||||
handle = LoadLibrary(LIB_NAME);
|
handle = LoadDynamicLibrary(LIB_NAME);
|
||||||
return (handle != NULL);
|
return (handle != NULL);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -101,9 +101,15 @@ base *drawd3d9_init(void)
|
|||||||
HINSTANCE fxhandle = NULL;
|
HINSTANCE fxhandle = NULL;
|
||||||
for (int idx = 99; idx >= 0; idx--) // a shameful moogle
|
for (int idx = 99; idx >= 0; idx--) // a shameful moogle
|
||||||
{
|
{
|
||||||
|
#ifdef UNICODE
|
||||||
wchar_t dllbuf[13];
|
wchar_t dllbuf[13];
|
||||||
wsprintf(dllbuf, TEXT("d3dx9_%d.dll"), idx);
|
wsprintf(dllbuf, TEXT("d3dx9_%d.dll"), idx);
|
||||||
fxhandle = LoadLibrary(dllbuf);
|
fxhandle = LoadLibrary(dllbuf);
|
||||||
|
#else
|
||||||
|
char dllbuf[13];
|
||||||
|
sprintf(dllbuf, "d3dx9_%d.dll", idx);
|
||||||
|
fxhandle = LoadLibraryA(dllbuf);
|
||||||
|
#endif
|
||||||
if (fxhandle != NULL)
|
if (fxhandle != NULL)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -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);
|
float aspect = (float)(info.rcMonitor.right - info.rcMonitor.left) / (float)(info.rcMonitor.bottom - info.rcMonitor.top);
|
||||||
|
|
||||||
// allocate a new monitor info
|
// allocate a new monitor info
|
||||||
char *temp = utf8_from_wstring(info.szDevice);
|
char *temp = utf8_from_tstring(info.szDevice);
|
||||||
// copy in the data
|
// copy in the data
|
||||||
monitor = global_alloc(win_monitor_info(handle, temp, aspect));
|
monitor = global_alloc(win_monitor_info(handle, temp, aspect));
|
||||||
osd_free(temp);
|
osd_free(temp);
|
||||||
|
Loading…
Reference in New Issue
Block a user