diff options
Diffstat (limited to 'base/string_util_posix.h')
-rw-r--r-- | base/string_util_posix.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/string_util_posix.h b/base/string_util_posix.h index b503685a..75cf4b4 100644 --- a/base/string_util_posix.h +++ b/base/string_util_posix.h @@ -33,6 +33,14 @@ inline int vsnprintf(char* buffer, size_t size, return ::vsnprintf(buffer, size, format, arguments); } +inline int strncmp16(const char16* s1, const char16* s2, size_t count) { +#if defined(WCHAR_T_IS_UTF16) + return ::wcsncmp(s1, s2, count); +#elif defined(WCHAR_T_IS_UTF32) + return c16memcmp(s1, s2, count); +#endif +} + inline int vswprintf(wchar_t* buffer, size_t size, const wchar_t* format, va_list arguments) { DCHECK(IsWprintfFormatPortable(format)); |