diff options
Diffstat (limited to 'lib/libc/string/bcopy.c')
-rw-r--r-- | lib/libc/string/bcopy.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c index 2a6343b..8f8a8cf 100644 --- a/lib/libc/string/bcopy.c +++ b/lib/libc/string/bcopy.c @@ -40,8 +40,6 @@ static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93"; #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <string.h> - /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES @@ -56,21 +54,22 @@ typedef int word; /* "word" used for optimal copy speed */ * This is the routine that actually implements * (the portable versions of) bcopy, memcpy, and memmove. */ -#ifdef MEMCOPY +#if defined(MEMCOPY) || defined(MEMMOVE) +#include <string.h> + void * -memcpy(dst0, src0, length) +#ifdef MEMCOPY +memcpy #else -#ifdef MEMMOVE -void * -memmove(dst0, src0, length) +memmove +#endif +(void *dst0, const void *src0, size_t length) #else +#include <strings.h> + void -bcopy(src0, dst0, length) -#endif +bcopy(const void *src0, void *dst0, size_t length) #endif - void *dst0; - const void *src0; - size_t length; { char *dst = dst0; const char *src = src0; |