commit 5aabc7e6aad28327d75671e52c50060e4543112c Author: sin Date: Mon Feb 25 13:01:12 2019 +0000 Make use of builtins whenever possible diff --git a/include/string.h b/include/string.h index 43c7485..66c23e1 100644 --- a/include/string.h +++ b/include/string.h @@ -50,7 +50,7 @@ _FORTIFY_FN(memcpy) void *memcpy(void *__od, const void *__os, size_t __n) __builtin_trap(); if (__n > __bd || __n > __bs) __builtin_trap(); - return __orig_memcpy(__od, __os, __n); + return __builtin_memcpy(__od, __os, __n); } _FORTIFY_FN(memmove) void *memmove(void *__d, const void *__s, size_t __n) @@ -69,7 +69,7 @@ _FORTIFY_FN(memset) void *memset(void *__d, int __c, size_t __n) if (__n > __b) __builtin_trap(); - return __orig_memset(__d, __c, __n); + return __builtin_memset(__d, __c, __n); } #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ diff --git a/include/wchar.h b/include/wchar.h index 3cb6f92..09ffa97 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -121,7 +121,7 @@ _FORTIFY_FN(wcrtomb) size_t wcrtomb(char *__s, wchar_t __w, mbstate_t *__st) return __r; if (__r > __b) __builtin_trap(); - memcpy(__s, __buf, __r); + __builtin_memcpy(__s, __buf, __r); return __r; } return __orig_wcrtomb(__s, __w, __st);