mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[util] Use transcodeString in createDirectory function
This commit is contained in:
parent
65070bd765
commit
1c08725acd
@ -115,9 +115,14 @@ namespace dxvk::env {
|
|||||||
|
|
||||||
bool createDirectory(const std::string& path) {
|
bool createDirectory(const std::string& path) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WCHAR widePath[MAX_PATH];
|
std::array<WCHAR, MAX_PATH + 1> widePath;
|
||||||
str::tows(path.c_str(), widePath);
|
|
||||||
return !!CreateDirectoryW(widePath, nullptr);
|
size_t length = str::transcodeString(
|
||||||
|
widePath.data(), widePath.size() - 1,
|
||||||
|
path.data(), path.size());
|
||||||
|
|
||||||
|
widePath[length] = L'\0';
|
||||||
|
return !!CreateDirectoryW(widePath.data(), nullptr);
|
||||||
#else
|
#else
|
||||||
return std::filesystem::create_directories(path);
|
return std::filesystem::create_directories(path);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user