aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-12-26 06:22:47 -0800
committerH. Peter Anvin <hpa@zytor.com>2018-12-26 06:22:47 -0800
commit06f72bb968a3f0a10d0ed37524075bd6388e2090 (patch)
tree433288cdf6b4a61cbe9d2e60b01966284bf153fb /include
parent77703ae4a4fedbea22d80cad77e5a637e164ba76 (diff)
downloadnasm-06f72bb968a3f0a10d0ed37524075bd6388e2090.tar.gz
nasm-06f72bb968a3f0a10d0ed37524075bd6388e2090.tar.xz
nasm-06f72bb968a3f0a10d0ed37524075bd6388e2090.zip
Test for the mempcpy() function and add alternative if missing
If memcpy() doesn't exist, then add an inline alternative using memcpy(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'include')
-rw-r--r--include/compiler.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/compiler.h b/include/compiler.h
index 7a80e2e4..b390bc2d 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -219,6 +219,13 @@ char *strsep(char **, const char *);
size_t strnlen(const char *s, size_t maxlen);
#endif
+#ifndef HAVE_MEMPCPY
+static inline void *mempcpy(void *dst, const void *src, size_t n)
+{
+ return memcpy(dst, src, n) + n;
+}
+#endif
+
/*
* Hack to support external-linkage inline functions
*/