Files
clang-p2996/clang/test/CodeGen/memcpy-nobuiltin.inc
serge-sans-paille d437fba8ef Reapply Allow system header to provide their own implementation of some builtin
This reverts commit 3d210ed3d1.

See https://reviews.llvm.org/D71082 for the patch and discussion that make it
possible to reapply this patch.
2020-01-17 09:58:32 +01:00

20 lines
433 B
C++

#include <stddef.h>
extern void *memcpy(void *dest, void const *from, size_t n);
#ifdef WITH_DECL
inline void *memcpy(void *dest, void const *from, size_t n) {
char const *ifrom = from;
char *idest = dest;
while (n--)
*idest++ = *ifrom++;
return dest;
}
#endif
#ifdef WITH_SELF_REFERENCE_DECL
inline void *memcpy(void *dest, void const *from, size_t n) {
if (n != 0)
memcpy(dest, from, n);
return dest;
}
#endif