aboutsummaryrefslogtreecommitdiff
path: root/libc/src/wchar/wmempcpy.cpp
blob: d8b89c0a88d051a9e7b243f661d77414576b5ee7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
}

} // namespace LIBC_NAMESPACE_DECL