File tree Expand file tree Collapse file tree 4 files changed +6
-40
lines changed Expand file tree Collapse file tree 4 files changed +6
-40
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ LIBC_INLINE size_t string_length_wide_read(const char *src) {
7979 return char_ptr - src;
8080}
8181
82- LIBC_INLINE size_t string_length_byte_read (const char *src) {
82+ template <typename T>
83+ LIBC_INLINE size_t string_length_trivial (const T *src) {
8384 size_t length;
8485 for (length = 0 ; *src; ++src, ++length)
8586 ;
@@ -96,7 +97,7 @@ LIBC_INLINE size_t string_length(const char *src) {
9697 // string a block at a time.
9798 return string_length_wide_read<unsigned int >(src);
9899#else
99- return string_length_byte_read (src);
100+ return string_length_trivial (src);
100101#endif
101102}
102103
Original file line number Diff line number Diff line change 1- add_header_library(
2- wide_string_utils
3- HDRS
4- wide_string_utils.h
5- )
6-
71add_entrypoint_object(
82 wcslen
93 SRCS
104 wcslen.cpp
115 HDRS
126 wcslen.h
137 DEPENDS
14- .wide_string_utils
158 libc.hdr.types.size_t
169 libc.hdr.types.wchar_t
10+ libc.src.string .string_utils
1711)
1812
1913add_entrypoint_object(
Original file line number Diff line number Diff line change 1212#include " hdr/types/wchar_t.h"
1313#include " src/__support/common.h"
1414#include " src/__support/macros/config.h"
15- #include " src/wchar/wide_string_utils .h"
15+ #include " src/string/string_utils .h" // string_length_trivial
1616
1717namespace LIBC_NAMESPACE_DECL {
1818
1919LLVM_LIBC_FUNCTION (size_t , wcslen, (const wchar_t *src)) {
20- return internal::wide_string_length (src);
20+ return internal::string_length_trivial (src);
2121}
2222
2323} // namespace LIBC_NAMESPACE_DECL
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments