summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/string.h4
-rw-r--r--libc/string/generic/mempcpy.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/include/string.h b/include/string.h
index 1d75f449f..80585ef94 100644
--- a/include/string.h
+++ b/include/string.h
@@ -258,7 +258,9 @@ extern void *memmem (const void *__haystack, size_t __haystacklen,
/* Copy N bytes of SRC to DEST, return pointer to bytes after the
last written byte. */
-#if 0 /* uClibc: disabled */
+#if __GNUC_PREREQ (3, 4)
+# define __mempcpy(dest, src, n) __builtin_mempcpy(dest, src, n)
+#else /* uClibc: disabled */
extern void *__mempcpy (void *__restrict __dest,
const void *__restrict __src, size_t __n)
__THROW __nonnull ((1, 2));
diff --git a/libc/string/generic/mempcpy.c b/libc/string/generic/mempcpy.c
index d7fa79ef5..bb5563a6a 100644
--- a/libc/string/generic/mempcpy.c
+++ b/libc/string/generic/mempcpy.c
@@ -16,4 +16,5 @@ void *mempcpy (void *dstpp, const void *srcpp, size_t len)
return (void *)(((char *)dstpp) + len);
}
libc_hidden_weak(mempcpy)
+strong_alias(mempcpy,__mempcpy)
#endif