Fix UWP build in non-UNICODE mode

This commit is contained in:
Anonymous Maarten
2024-07-19 00:28:49 +02:00
committed by Anonymous Maarten
parent c59771d7fc
commit ccebbb6c6e
8 changed files with 25 additions and 25 deletions

View File

@@ -53,7 +53,7 @@ int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_Enumer
// also prevent any wildcards inserted by the app from being respected.
SDL_snprintf(pattern, patternlen, "%s\\*", path);
WCHAR *wpattern = WIN_UTF8ToString(pattern);
WCHAR *wpattern = WIN_UTF8ToStringW(pattern);
SDL_free(pattern);
if (!wpattern) {
return -1;
@@ -75,7 +75,7 @@ int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_Enumer
}
}
char *utf8fn = WIN_StringToUTF8(fn);
char *utf8fn = WIN_StringToUTF8W(fn);
if (!utf8fn) {
retval = -1;
} else {
@@ -92,7 +92,7 @@ int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_Enumer
int SDL_SYS_RemovePath(const char *path)
{
WCHAR *wpath = WIN_UTF8ToString(path);
WCHAR *wpath = WIN_UTF8ToStringW(path);
if (!wpath) {
return -1;
}
@@ -114,12 +114,12 @@ int SDL_SYS_RemovePath(const char *path)
int SDL_SYS_RenamePath(const char *oldpath, const char *newpath)
{
WCHAR *woldpath = WIN_UTF8ToString(oldpath);
WCHAR *woldpath = WIN_UTF8ToStringW(oldpath);
if (!woldpath) {
return -1;
}
WCHAR *wnewpath = WIN_UTF8ToString(newpath);
WCHAR *wnewpath = WIN_UTF8ToStringW(newpath);
if (!wnewpath) {
SDL_free(woldpath);
return -1;
@@ -133,7 +133,7 @@ int SDL_SYS_RenamePath(const char *oldpath, const char *newpath)
int SDL_SYS_CreateDirectory(const char *path)
{
WCHAR *wpath = WIN_UTF8ToString(path);
WCHAR *wpath = WIN_UTF8ToStringW(path);
if (!wpath) {
return -1;
}
@@ -145,7 +145,7 @@ int SDL_SYS_CreateDirectory(const char *path)
int SDL_SYS_GetPathInfo(const char *path, SDL_PathInfo *info)
{
WCHAR *wpath = WIN_UTF8ToString(path);
WCHAR *wpath = WIN_UTF8ToStringW(path);
if (!wpath) {
return -1;
}

View File

@@ -113,7 +113,7 @@ extern "C" const char *SDL_GetWinRTFSPath(SDL_WinRT_Path pathType)
return NULL;
}
char *utf8Path = WIN_StringToUTF8(ucs2Path);
char *utf8Path = WIN_StringToUTF8W(ucs2Path);
utf8Paths[pathType] = utf8Path;
SDL_free(utf8Path);
return utf8Paths[pathType].c_str();
@@ -176,12 +176,12 @@ extern "C" char *SDL_SYS_GetPrefPath(const char *org, const char *app)
}
SDL_wcslcpy(path, srcPath, SDL_arraysize(path));
worg = WIN_UTF8ToString(org);
worg = WIN_UTF8ToStringW(org);
if (!worg) {
return NULL;
}
wapp = WIN_UTF8ToString(app);
wapp = WIN_UTF8ToStringW(app);
if (!wapp) {
SDL_free(worg);
return NULL;
@@ -225,7 +225,7 @@ extern "C" char *SDL_SYS_GetPrefPath(const char *org, const char *app)
SDL_wcslcat(path, L"\\", new_wpath_len + 1);
retval = WIN_StringToUTF8(path);
retval = WIN_StringToUTF8W(path);
return retval;
}
@@ -257,7 +257,7 @@ char *SDL_SYS_GetUserFolder(SDL_Folder folder)
wpath += L"\\";
return WIN_StringToUTF8(wpath.c_str());
return WIN_StringToUTF8W(wpath.c_str());
}
#endif /* SDL_PLATFORM_WINRT */