diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2015-12-22 10:56:08 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2015-12-22 14:32:49 +0100 |
commit | 2a3ffa836a3a9f94f19ee2671f41c1851221a105 (patch) | |
tree | c741bd03f75cac3b88f7b094423b7832eef71c17 /include/string.h | |
parent | 74b17c7956b8f0bd109b0fd26a8a9869441d09bf (diff) |
Use gcc's __builtin_mempcpy() as __mempcpy(), if possible
Patch from OpenWrt.
Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
Diffstat (limited to 'include/string.h')
-rw-r--r-- | include/string.h | 4 |
1 files changed, 3 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)); |