diff options
author | Aaron Crane <arc@cpan.org> | 2017-10-12 14:31:56 +0200 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2017-10-21 16:51:41 +0100 |
commit | e5d7f4e5fdc8fcb324745c39345b369ab04cadb1 (patch) | |
tree | 9aeeb835318cb50fb6138be90b6ce8e375dd3c9c /util.c | |
parent | 6abb197755380da4c7221427281d6933762516a3 (diff) | |
download | perl-e5d7f4e5fdc8fcb324745c39345b369ab04cadb1.tar.gz |
Assume we have sane C89 memcmp()
"Sane" means that it works correctly on bytes with their high bit set, as
C89 also requires.
We therefore no longer need to probe for and/or use BSD bcmp().
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -2223,25 +2223,6 @@ Perl_unlnk(pTHX_ const char *f) /* unlink all versions of a file */ } #endif -/* this is a drop-in replacement for memcmp() */ -#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP) -int -Perl_my_memcmp(const void *vs1, const void *vs2, size_t len) -{ - const U8 *a = (const U8 *)vs1; - const U8 *b = (const U8 *)vs2; - int tmp; - - PERL_ARGS_ASSERT_MY_MEMCMP; - - while (len--) { - if ((tmp = *a++ - *b++)) - return tmp; - } - return 0; -} -#endif /* !HAS_MEMCMP || !HAS_SANE_MEMCMP */ - #ifndef HAS_VPRINTF /* This vsprintf replacement should generally never get used, since vsprintf was available in both System V and BSD 2.11. (There may |