Chromium Code Reviews| Index: util/stdlib/strlcpy.cc |
| diff --git a/util/stdlib/strlcpy.cc b/util/stdlib/strlcpy.cc |
| index 90d6d96ecc71c55ce200e9fb70506ed4944f32ce..8c6d469be55020767b124802d028c0e6f793cd56 100644 |
| --- a/util/stdlib/strlcpy.cc |
| +++ b/util/stdlib/strlcpy.cc |
| @@ -14,8 +14,25 @@ |
| #include "util/stdlib/strlcpy.h" |
| +#include "build/build_config.h" |
| + |
| +#if defined(OS_WIN) && defined(WCHAR_T_IS_UTF16) |
| +#include <strsafe.h> |
| +#endif |
| + |
| namespace crashpad { |
| +#if defined(OS_WIN) && defined(WCHAR_T_IS_UTF16) |
| + |
| +size_t c16lcpy(base::char16* destination, |
| + const base::char16* source, |
| + size_t length) { |
| + StringCchCopyW(destination, length, source); |
|
Mark Mentovai
2015/10/23 20:24:32
CHECK that the return value is either of the two a
scottmg
2015/10/23 20:32:40
Done.
|
| + return wcslen(source); |
| +} |
| + |
| +#elif defined(WCHAR_T_IS_UTF32) |
| + |
| size_t c16lcpy(base::char16* destination, |
| const base::char16* source, |
| size_t length) { |
| @@ -29,4 +46,6 @@ size_t c16lcpy(base::char16* destination, |
| return source_length; |
| } |
| +#endif // WCHAR_T_IS_UTF32 |
| + |
| } // namespace crashpad |