summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/util.c b/util.c
index 4c9516b872..386707bcc4 100644
--- a/util.c
+++ b/util.c
@@ -2265,10 +2265,13 @@ Perl_unlnk(pTHX_ const char *f) /* unlink all versions of a file */
/* this is a drop-in replacement for bcopy(), except for the return
* value, which we need to be able to emulate memcpy() */
-#if (!defined(HAS_MEMCPY) && !defined(HAS_BCOPY)) || (!defined(HAS_MEMMOVE) && !defined(HAS_SAFE_MEMCPY) && !defined(HAS_SAFE_BCOPY))
+#if !defined(HAS_MEMCPY) || (!defined(HAS_MEMMOVE) && !defined(HAS_SAFE_MEMCPY))
void *
Perl_my_bcopy(const void *vfrom, void *vto, size_t len)
{
+#if defined(HAS_BCOPY) && defined(HAS_SAFE_BCOPY)
+ bcopy(vfrom, vto, len);
+#else
const unsigned char *from = (const unsigned char *)vfrom;
unsigned char *to = (unsigned char *)vto;
@@ -2284,6 +2287,8 @@ Perl_my_bcopy(const void *vfrom, void *vto, size_t len)
while (len--)
*(--to) = *(--from);
}
+#endif
+
return vto;
}
#endif