From 0aafa0f714ffb2afe43712abb1098cc4318ed02d Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Fri, 3 Apr 2020 10:12:44 -0700 Subject: [PATCH] adb: add implementation of mempcpy for deficient platforms. Test: none Change-Id: Ic2f4e1c85c9f02e804d849c6cb60b22e15e981d6 --- adb/sysdeps.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adb/sysdeps.h b/adb/sysdeps.h index 9a879b57b..7ea30d159 100644 --- a/adb/sysdeps.h +++ b/adb/sysdeps.h @@ -42,6 +42,12 @@ #include "sysdeps/network.h" #include "sysdeps/stat.h" +#if defined(__APPLE__) +static void* mempcpy(void* dst, const void* src, size_t n) { + return static_cast(memcpy(dst, src, n)) + n; +} +#endif + #ifdef _WIN32 // Clang-only nullability specifiers