diff options
author | Max Kellermann <max@musicpd.org> | 2018-09-06 19:49:45 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-09-06 19:49:45 +0200 |
commit | 2d6f9f9a9c985c9a2e1fc155fdaa3fe07a57440b (patch) | |
tree | ef1ddf045bc1e93fbfe0f8010d4aab52d9e7ae6f /src/util | |
parent | c2e2e5543ed75f258958b6d31cff6751accbed4f (diff) |
Util/WStringAPI: non-Windows implementation of _wcs*cmp()
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/WStringAPI.hxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/util/WStringAPI.hxx b/src/util/WStringAPI.hxx index 739c4efd5..1cbf5dcd5 100644 --- a/src/util/WStringAPI.hxx +++ b/src/util/WStringAPI.hxx @@ -149,13 +149,15 @@ StringIsEqual(const wchar_t *a, const wchar_t *b, size_t length) noexcept return wcsncmp(a, b, length) == 0; } -#ifdef _WIN32 - gcc_pure gcc_nonnull_all static inline bool StringIsEqualIgnoreCase(const wchar_t *a, const wchar_t *b) noexcept { +#ifdef _WIN32 return _wcsicmp(a, b) == 0; +#else + return wcscasecmp(a, b) == 0; +#endif } gcc_pure gcc_nonnull_all @@ -163,10 +165,12 @@ static inline bool StringIsEqualIgnoreCase(const wchar_t *a, const wchar_t *b, size_t size) noexcept { +#ifdef _WIN32 return _wcsnicmp(a, b, size) == 0; -} - +#else + return wcsncasecmp(a, b, size) == 0; #endif +} gcc_pure gcc_nonnull_all static inline int |