You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
433 B
20 lines
433 B
7 months ago
|
#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
|