mirror of https://github.com/mgba-emu/mgba.git
Scripting: Why does this function take PCWSTR??
This commit is contained in:
parent
6e196748d8
commit
b42b997f00
|
@ -486,7 +486,7 @@ bool _luaLoad(struct mScriptEngineContext* ctx, const char* filename, struct VFi
|
||||||
snprintf(name, sizeof(name), "=%s", filename + 1);
|
snprintf(name, sizeof(name), "=%s", filename + 1);
|
||||||
} else {
|
} else {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char dirname[PATH_MAX] = {0};
|
wchar_t dirname[PATH_MAX] = {0};
|
||||||
const char* lastSlash = strrchr(filename, '/');
|
const char* lastSlash = strrchr(filename, '/');
|
||||||
const char* lastBackslash = strrchr(filename, '\\');
|
const char* lastBackslash = strrchr(filename, '\\');
|
||||||
if (lastSlash && lastBackslash) {
|
if (lastSlash && lastBackslash) {
|
||||||
|
@ -497,7 +497,7 @@ bool _luaLoad(struct mScriptEngineContext* ctx, const char* filename, struct VFi
|
||||||
lastSlash = lastBackslash;
|
lastSlash = lastBackslash;
|
||||||
}
|
}
|
||||||
if (lastSlash) {
|
if (lastSlash) {
|
||||||
strncpy(dirname, filename, lastSlash - filename);
|
MultiByteToWideChar(CP_UTF8, 0, filename, lastSlash - filename, dirname, PATH_MAX);
|
||||||
AddDllDirectory(dirname);
|
AddDllDirectory(dirname);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue