blob: 0045f0ece3f9c7481f847cc2f6160f089e40199d (
plain) (
blame)
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
26
27
28
29
30
31
32
|
// Copyright 2022 Alejandro Colomar <alx@kernel.org>
// SPDX-License-Identifier: LGPL-3.0-or-later WITH LGPL-3.0-linking-exception
#ifndef INCLUDE_C_STP_USTP_USTPCPY_H_
#define INCLUDE_C_STP_USTP_USTPCPY_H_
#include <stddef.h>
#include <string.h>
#include <c/stp/_compiler.h> // IWYU pragma: keep
#pragma clang assume_nonnull begin
inline char *c_ustpcpy(char *restrict dst, const char *restrict src,
size_t len);
inline char *
c_ustpcpy(char *restrict dst, const char *restrict src, size_t len)
{
#if defined(_GNU_SOURCE)
return mempcpy(dst, src, len);
#else
return memcpy(dst, src, len) + len;
#endif
}
#pragma clang assume_nonnull end
#endif // Header guard
|