Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: util/stdlib/strlcpy.cc

Issue 1417403004: win: Implement c16lcpy without base:c16* (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698