summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2016-03-04 00:21:27 +0100
committerTony Cook <tony@develop-help.com>2016-03-07 10:59:51 +1100
commitaf4291a85942657772fedc3db017e89100bd916a (patch)
tree165f16a5b1a0e6a1619a5b9d19ac0a3c18765b9e /util.c
parent99fff99d79aa793bf9a6e0ce2bb18ced085ad1e2 (diff)
downloadperl-af4291a85942657772fedc3db017e89100bd916a.tar.gz
make building without memcpy work (RT #127619)
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