diff options
| author | Martin Ridgers <[email protected]> | 2021-10-20 13:17:09 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-10-20 13:17:09 +0200 |
| commit | 3a430e7c5644a4c4bf3ef5ec94cef21ce5bd15a3 (patch) | |
| tree | 7d0d5a044da444a035b38e1bde073d02c058ac2a | |
| parent | Fixed concrete Visitor to use the correct argument types (diff) | |
| download | zen-3a430e7c5644a4c4bf3ef5ec94cef21ce5bd15a3.tar.xz zen-3a430e7c5644a4c4bf3ef5ec94cef21ce5bd15a3.zip | |
Compile fixes due to std::fs::path's differing character types
| -rw-r--r-- | zenstore/filecas.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp index 4d4a071e8..3eccf53ff 100644 --- a/zenstore/filecas.cpp +++ b/zenstore/filecas.cpp @@ -370,7 +370,7 @@ FileCasStrategy::IterateChunks(std::function<void(const IoHash& Hash, BasicFile& std::filesystem::path RelPath = std::filesystem::relative(Parent, RootDirectory); - std::wstring PathString = RelPath.native(); + std::filesystem::path::string_type PathString = RelPath.native(); if ((PathString.size() == (3 + 2 + 1)) && (File.size() == (40 - 3 - 2))) { @@ -380,12 +380,15 @@ FileCasStrategy::IterateChunks(std::function<void(const IoHash& Hash, BasicFile& } PathString.append(File); - StringBuilder<64> Utf8; - WideToUtf8(PathString, Utf8); - // TODO: should validate that we're actually dealing with a valid hex string here +#if ZEN_PLATFORM_WINDOWS + StringBuilder<64> Utf8; + WideToUtf8(PathString, Utf8); IoHash NameHash = IoHash::FromHexString({Utf8.Data(), Utf8.Size()}); +#else + IoHash NameHash = IoHash::FromHexString(PathString); +#endif BasicFile PayloadFile; std::error_code Ec; |