[libc-commits] [libc] [libc][wchar] implement wcslen (PR #124150)

via libc-commits libc-commits at lists.llvm.org
Thu Jan 23 09:19:30 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 4bd0440bd2a653644987dddf8ec8d9d1f258ce31 a8173a11e5d61d524a1ce64768536b4e1da9b4ac --extensions h,cpp -- libc/src/wchar/wcslen.cpp libc/src/wchar/wcslen.h libc/src/wchar/wide_string_utils.h libc/test/src/wchar/wcslen_test.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/wchar/wcslen.h b/libc/src/wchar/wcslen.h
index 7c022533e9..8b2e7f50b0 100644
--- a/libc/src/wchar/wcslen.h
+++ b/libc/src/wchar/wcslen.h
@@ -15,7 +15,7 @@
 
 namespace LIBC_NAMESPACE_DECL {
 
-size_t wcslen (const wchar_t *src);
+size_t wcslen(const wchar_t *src);
 
 } // namespace LIBC_NAMESPACE_DECL
 
diff --git a/libc/src/wchar/wide_string_utils.h b/libc/src/wchar/wide_string_utils.h
index dba01d2885..a30acf02aa 100644
--- a/libc/src/wchar/wide_string_utils.h
+++ b/libc/src/wchar/wide_string_utils.h
@@ -9,9 +9,9 @@
 #ifndef LLVM_LIBC_SRC_WCHAR_WIDE_STRING_UTILS_H
 #define LLVM_LIBC_SRC_WCHAR_WIDE_STRING_UTILS_H
 
-#include "src/__support/macros/config.h"
 #include "hdr/types/size_t.h"
 #include "hdr/types/wchar_t.h"
+#include "src/__support/macros/config.h"
 
 namespace LIBC_NAMESPACE_DECL {
 namespace internal {
diff --git a/libc/test/src/wchar/wcslen_test.cpp b/libc/test/src/wchar/wcslen_test.cpp
index fe975cea59..e50271fcec 100644
--- a/libc/test/src/wchar/wcslen_test.cpp
+++ b/libc/test/src/wchar/wcslen_test.cpp
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/wchar/wcslen.h"
-#include "hdr/types/wchar_t.h"
 #include "hdr/types/size_t.h"
+#include "hdr/types/wchar_t.h"
+#include "src/wchar/wcslen.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcWCSLenTest, EmptyString) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/124150


More information about the libc-commits mailing list