[libc-commits] [libc] [libc] Implemented wmempcpy (PR #142067)

via libc-commits libc-commits at lists.llvm.org
Fri May 30 01:38:55 PDT 2025


================
@@ -0,0 +1,25 @@
+//===-- Implementation of wmempcpy ----------------------------------------===//
+//
+// 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/wmempcpy.h"
+
+#include "hdr/types/size_t.h"
+#include "hdr/types/wchar_t.h"
+#include "src/__support/common.h"
+#include "src/string/memory_utils/inline_memcpy.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(wchar_t *, wmempcpy,
+                   (wchar_t *__restrict to, const wchar_t *__restrict from,
+                    size_t size)) {
+  inline_memcpy(to, from, size * sizeof(wchar_t));
+  return reinterpret_cast<wchar_t *>(to) + size;
----------------
DesWurstes wrote:

https://man7.org/linux/man-pages/man3/wmemcpy.3.html should return "to"?

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


More information about the libc-commits mailing list