[libc-commits] [libc] [libc] add wmemchr, wcslen, wcschr, wcsrchr, wcspbrk, wcsstr (PR #121183)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Mon Jan 6 13:14:09 PST 2025
- Previous message: [libc-commits] [libc] [libc] add wmemchr, wcslen, wcschr, wcsrchr, wcspbrk, wcsstr (PR #121183)
- Next message: [libc-commits] [libc] [libc] add wmemchr, wcslen, wcschr, wcsrchr, wcspbrk, wcsstr (PR #121183)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
================
@@ -0,0 +1,37 @@
+//===-- Implementation of wcspbrk -----------------------------------------===//
+//
+// 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/wcspbrk.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+#include "wcslen.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(const wchar_t *, wcspbrk,
+ (const wchar_t *wcs, const wchar_t *accept)) {
+ size_t n_accept = wcslen(accept);
+
+ for (size_t i = 0; i < wcslen(wcs); i++) {
----------------
nickdesaulniers wrote:
I don't think we can implement `wcspbrk` in terms of `wcslen`; what if the users has configured llvm-libc to not include `wcslen`?
https://github.com/llvm/llvm-project/pull/121183
- Previous message: [libc-commits] [libc] [libc] add wmemchr, wcslen, wcschr, wcsrchr, wcspbrk, wcsstr (PR #121183)
- Next message: [libc-commits] [libc] [libc] add wmemchr, wcslen, wcschr, wcsrchr, wcspbrk, wcsstr (PR #121183)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the libc-commits
mailing list