From: Jan Janssen Date: Tue, 6 Sep 2022 08:13:50 +0000 (+0200) Subject: boot: Add mempcpy X-Git-Tag: v252-rc1~232^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa23f91ed677e4e3f89687c94b74b1afc600324c;p=thirdparty%2Fsystemd.git boot: Add mempcpy --- diff --git a/src/boot/efi/efi-string.h b/src/boot/efi/efi-string.h index c25349c0e1e..57899c978bf 100644 --- a/src/boot/efi/efi-string.h +++ b/src/boot/efi/efi-string.h @@ -112,6 +112,13 @@ bool parse_number16(const char16_t *s, uint64_t *ret_u, const char16_t **ret_tai # define memcmp __builtin_memcmp # define memcpy __builtin_memcpy # define memset __builtin_memset + +static inline void *mempcpy(void * restrict dest, const void * restrict src, size_t n) { + if (!dest || !src || n == 0) + return dest; + memcpy(dest, src, n); + return (uint8_t *) dest + n; +} #endif /* The actual implementations of builtins with efi_ prefix so we can unit test them. */