aboutsummaryrefslogtreecommitdiff
path: root/include/platform.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-01-25 22:08:46 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2015-01-25 22:08:46 +0100
commit50a6d86520b2c45a70a3d0e2d19fde37c49d8c90 (patch)
treeeb9e0e3bf04b78fde616c5b2e144c8ebceae9dd4 /include/platform.h
parentcc70b6f8b6c6441e1c48690c7885700a2d389946 (diff)
downloadbusybox-50a6d86520b2c45a70a3d0e2d19fde37c49d8c90.tar.gz
platform.h: add compat mempcpy
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/platform.h')
-rw-r--r--include/platform.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/platform.h b/include/platform.h
index 09c7ccd9c..f00669695 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -370,6 +370,7 @@ typedef unsigned smalluint;
#define HAVE_SETBIT 1
#define HAVE_SIGHANDLER_T 1
#define HAVE_STPCPY 1
+#define HAVE_MEMPCPY 1
#define HAVE_STRCASESTR 1
#define HAVE_STRCHRNUL 1
#define HAVE_STRSEP 1
@@ -450,6 +451,7 @@ typedef unsigned smalluint;
#endif
#if defined(__FreeBSD__)
+//# undef HAVE_MEMPCPY - not yet confirmed
# undef HAVE_CLEARENV
# undef HAVE_FDATASYNC
# undef HAVE_MNTENT_H
@@ -513,6 +515,13 @@ typedef void (*sighandler_t)(int);
extern char *stpcpy(char *p, const char *to_add) FAST_FUNC;
#endif
+#ifndef HAVE_MEMPCPY
+static ALWAYS_INLINE void *mempcpy(void *dest, const void *src, size_t len)
+{
+ return memcpy(dest, src, len) + len;
+}
+#endif
+
#ifndef HAVE_STRCASESTR
extern char *strcasestr(const char *s, const char *pattern) FAST_FUNC;
#endif