[libc-commits] [libc] [libc] wcsspn implementation (PR #142034)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Fri May 30 10:45:59 PDT 2025


================
@@ -0,0 +1,34 @@
+//===-- Implementation of wcsspn ------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/wchar/wcsspn.h"
+
+#include "hdr/types/size_t.h"
+#include "hdr/types/wchar_t.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(size_t, wcsspn, (const wchar_t *s1, const wchar_t *s2)) {
+  size_t i = 0;
+  int in_s2 = 0;
----------------
michaelrj-google wrote:

`in_s2` is being used as a boolean, you should set it to be a boolean for clarity.

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


More information about the libc-commits mailing list