| 1 |
#include <stddef.h> |
| 2 |
extern void *memcpy(void *dest, void const *from, size_t n); |
| 3 |
|
| 4 |
#ifdef WITH_DECL |
| 5 |
inline __attribute__((always_inline)) __attribute__((gnu_inline)) void *memcpy(void *dest, void const *from, size_t n) { |
| 6 |
char const *ifrom = from; |
| 7 |
char *idest = dest; |
| 8 |
while (n--) |
| 9 |
*idest++ = *ifrom++; |
| 10 |
return dest; |
| 11 |
} |
| 12 |
#endif |
| 13 |
#ifdef WITH_SELF_REFERENCE_DECL |
| 14 |
inline __attribute__((always_inline)) __attribute__((gnu_inline)) void *memcpy(void *dest, void const *from, size_t n) { |
| 15 |
if (n != 0) |
| 16 |
memcpy(dest, from, n); |
| 17 |
return dest; |
| 18 |
} |
| 19 |
#endif |