[libc-commits] [libc] [libc] Implemented mblen functions (PR #150141)
Uzair Nawaz via libc-commits
libc-commits at lists.llvm.org
Thu Jul 24 09:58:16 PDT 2025
================
@@ -0,0 +1,35 @@
+//===-- Implementation of mblen -------------------------------------------===//
+//
+// 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/mblen.h"
+
+#include "hdr/types/size_t.h"
+#include "src/__support/common.h"
+#include "src/__support/libc_errno.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/wchar/mbrtowc.h"
+#include "src/__support/wchar/mbstate.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, mblen, (const char *__restrict s, size_t n)) {
----------------
uzairnawaz wrote:
__restrict not needed here (only 1 pointer)
Remember to update yaml as well
https://github.com/llvm/llvm-project/pull/150141
More information about the libc-commits
mailing list