]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Add mempcpy
authorJan Janssen <medhefgo@web.de>
Tue, 6 Sep 2022 08:13:50 +0000 (10:13 +0200)
committerJan Janssen <medhefgo@web.de>
Wed, 7 Sep 2022 10:51:10 +0000 (12:51 +0200)
src/boot/efi/efi-string.h

index c25349c0e1e2ce607cdda946c426608c78dc72cc..57899c978bf7a1e2a54c225696629ea5cb6b4bf3 100644 (file)
@@ -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. */