diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2018-05-09 00:13:16 +0200 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2018-05-09 00:13:16 +0200 |
commit | 2dd6739826c86ca96a6a1548fd2e0fb7c0eb8dd0 (patch) | |
tree | 39d2d1eed28bf2c231839dd118905fb34327628d /zen/zstring.cpp | |
parent | 9.9 (diff) | |
download | FreeFileSync-2dd6739826c86ca96a6a1548fd2e0fb7c0eb8dd0.tar.gz FreeFileSync-2dd6739826c86ca96a6a1548fd2e0fb7c0eb8dd0.tar.bz2 FreeFileSync-2dd6739826c86ca96a6a1548fd2e0fb7c0eb8dd0.zip |
10.0
Diffstat (limited to 'zen/zstring.cpp')
-rwxr-xr-x | zen/zstring.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zen/zstring.cpp b/zen/zstring.cpp index ce94fe56..afa62c93 100755 --- a/zen/zstring.cpp +++ b/zen/zstring.cpp @@ -54,7 +54,9 @@ int compareNoCaseUtf8(const char* lhs, size_t lhsLen, const char* rhs, size_t rh if (!cpL || !cpR) return static_cast<int>(!cpR) - static_cast<int>(!cpL); - static_assert(sizeof(wchar_t) == sizeof(impl::CodePoint), ""); +//support unit-testing on Windows: CodePoint is truncated to wchar_t +static_assert(sizeof(wchar_t) == sizeof(impl::CodePoint), ""); + const wchar_t charL = ::towlower(static_cast<wchar_t>(*cpL)); //ordering: towlower() converts to higher code points than towupper() const wchar_t charR = ::towlower(static_cast<wchar_t>(*cpR)); //uses LC_CTYPE category of current locale if (charL != charR) @@ -65,7 +67,7 @@ int compareNoCaseUtf8(const char* lhs, size_t lhsLen, const char* rhs, size_t rh } -int cmpStringNaturalLinux(const char* lhs, size_t lhsLen, const char* rhs, size_t rhsLen) +int cmpStringNaturalLinuxTest(const char* lhs, size_t lhsLen, const char* rhs, size_t rhsLen) { const char* const lhsEnd = lhs + lhsLen; const char* const rhsEnd = rhs + rhsLen; |