summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2017-10-12 14:31:56 +0200
committerAaron Crane <arc@cpan.org>2017-10-21 16:51:41 +0100
commite5d7f4e5fdc8fcb324745c39345b369ab04cadb1 (patch)
tree9aeeb835318cb50fb6138be90b6ce8e375dd3c9c
parent6abb197755380da4c7221427281d6933762516a3 (diff)
downloadperl-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().
-rwxr-xr-xConfigure116
-rw-r--r--Cross/config.sh-arm-linux3
-rw-r--r--Cross/config.sh-arm-linux-n7703
-rw-r--r--NetWare/config.wc3
-rw-r--r--NetWare/config_H.wc19
-rw-r--r--Porting/Glossary14
-rw-r--r--Porting/config.sh3
-rw-r--r--Porting/config_H19
-rwxr-xr-xconfig_h.SH19
-rw-r--r--configure.com4
-rw-r--r--embed.fnc3
-rw-r--r--embed.h3
-rw-r--r--ext/SDBM_File/sdbm.h38
-rw-r--r--handy.h9
-rw-r--r--hints/epix.sh1
-rw-r--r--hints/svr4.sh1
-rw-r--r--hints/svr5.sh1
-rw-r--r--perl.h21
-rw-r--r--plan9/config.plan919
-rw-r--r--plan9/config_h.sample19
-rw-r--r--plan9/config_sh.sample3
-rw-r--r--proto.h8
-rw-r--r--symbian/config.sh3
-rw-r--r--uconfig.h23
-rw-r--r--uconfig.sh3
-rw-r--r--uconfig64.sh3
-rw-r--r--util.c19
-rw-r--r--win32/config.ce3
-rw-r--r--win32/config.gc3
-rw-r--r--win32/config.vc3
-rw-r--r--win32/config_H.ce19
-rw-r--r--win32/config_H.gc19
-rw-r--r--win32/config_H.vc19
33 files changed, 32 insertions, 414 deletions
diff --git a/Configure b/Configure
index 66df8a8f19..eee9860be6 100755
--- a/Configure
+++ b/Configure
@@ -391,7 +391,6 @@ d_attribute_unused=''
d_attribute_warn_unused_result=''
d_printf_format_null=''
d_backtrace=''
-d_bcmp=''
d_builtin_choose_expr=''
d_builtin_expect=''
d_builtin_add_overflow=''
@@ -664,7 +663,6 @@ d_mbrtowc=''
d_mbstowcs=''
d_mbtowc=''
d_memchr=''
-d_memcmp=''
d_memmem=''
d_memrchr=''
d_mkdir=''
@@ -743,7 +741,6 @@ d_rename=''
d_rint=''
d_rmdir=''
d_round=''
-d_sanemcmp=''
d_sbrkproto=''
d_scalbn=''
d_scalbnl=''
@@ -11361,10 +11358,6 @@ set d_attribute_warn_unused_result
eval $setvar
$rm -f attrib*
-: see if bcmp exists
-set bcmp d_bcmp
-eval $inlibc
-
: see if getpgrp exists
set getpgrp d_getpgrp
eval $inlibc
@@ -16615,10 +16608,6 @@ eval $inlibc
set memchr d_memchr
eval $inlibc
-: see if memcmp exists
-set memcmp d_memcmp
-eval $inlibc
-
: see if memmem exists
set memmem d_memmem
eval $inlibc
@@ -17873,84 +17862,6 @@ eval $inlibc
set round d_round
eval $inlibc
-: see if memory.h is available.
-val=''
-set memory.h val
-eval $inhdr
-
-: See if it conflicts with string.h
-case "$val" in
-$define)
- case "$strings" in
- '') ;;
- *)
- $cppstdin $cppflags $cppminus < $strings > mem.h
- if $contains 'memcpy' mem.h >/dev/null 2>&1; then
- echo " "
- echo "We won't be including <memory.h>."
- val="$undef"
- fi
- $rm -f mem.h
- ;;
- esac
-esac
-set i_memory
-eval $setvar
-
-: can memcmp be trusted to compare relative magnitude?
-val="$undef"
-case "$d_memcmp" in
-"$define")
- echo " "
- echo "Checking if your memcmp() can compare relative magnitude..." >&4
- $cat >try.c <<EOCP
-#$i_memory I_MEMORY
-#$i_stdlib I_STDLIB
-#$i_string I_STRING
-#$i_unistd I_UNISTD
-EOCP
- $cat >>try.c <<'EOCP'
-#include <stdio.h>
-#ifdef I_MEMORY
-# include <memory.h>
-#endif
-#ifdef I_STDLIB
-# include <stdlib.h>
-#endif
-#ifdef I_STRING
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#ifdef I_UNISTD
-# include <unistd.h> /* Needed for NetBSD */
-#endif
-int main()
-{
-char a = -1;
-char b = 0;
-if ((a < b) && memcmp(&a, &b, 1) < 0)
- exit(1);
-exit(0);
-}
-EOCP
- set try
- if eval $compile_ok; then
- if $run ./try 2>/dev/null; then
- echo "Yes, it can."
- val="$define"
- else
- echo "No, it can't (it uses signed chars)."
- fi
- else
- echo "(I can't compile the test program, so we'll assume not...)"
- fi
- ;;
-esac
-$rm_try
-set d_sanemcmp
-eval $setvar
-
: see if prototype for sbrk is available
echo " "
set d_sbrkproto sbrk $i_unistd unistd.h
@@ -23395,6 +23306,30 @@ else
i_machcthr="$undef"
fi
+: see if memory.h is available.
+val=''
+set memory.h val
+eval $inhdr
+
+: See if it conflicts with string.h
+case "$val" in
+$define)
+ case "$strings" in
+ '') ;;
+ *)
+ $cppstdin $cppflags $cppminus < $strings > mem.h
+ if $contains 'memcpy' mem.h >/dev/null 2>&1; then
+ echo " "
+ echo "We won't be including <memory.h>."
+ val="$undef"
+ fi
+ $rm -f mem.h
+ ;;
+ esac
+esac
+set i_memory
+eval $setvar
+
: see if this is a mntent.h system
set mntent.h i_mntent
eval $inhdr
@@ -24512,7 +24447,6 @@ d_attribute_pure='$d_attribute_pure'
d_attribute_unused='$d_attribute_unused'
d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
d_backtrace='$d_backtrace'
-d_bcmp='$d_bcmp'
d_bsd='$d_bsd'
d_bsdgetpgrp='$d_bsdgetpgrp'
d_bsdsetpgrp='$d_bsdsetpgrp'
@@ -24769,7 +24703,6 @@ d_mbrtowc='$d_mbrtowc'
d_mbstowcs='$d_mbstowcs'
d_mbtowc='$d_mbtowc'
d_memchr='$d_memchr'
-d_memcmp='$d_memcmp'
d_memmem='$d_memmem'
d_memrchr='$d_memrchr'
d_mkdir='$d_mkdir'
@@ -24860,7 +24793,6 @@ d_rewinddir='$d_rewinddir'
d_rint='$d_rint'
d_rmdir='$d_rmdir'
d_round='$d_round'
-d_sanemcmp='$d_sanemcmp'
d_sbrkproto='$d_sbrkproto'
d_scalbn='$d_scalbn'
d_scalbnl='$d_scalbnl'
diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux
index 2be99d6b30..4b21af86a5 100644
--- a/Cross/config.sh-arm-linux
+++ b/Cross/config.sh-arm-linux
@@ -125,7 +125,6 @@ d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
d_backtrace='undef'
-d_bcmp='define'
d_bsd='undef'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -380,7 +379,6 @@ d_mbrtowc='undef'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
-d_memcmp='define'
d_memmem='undef'
d_memrchr='undef'
d_mkdir='define'
@@ -469,7 +467,6 @@ d_rewinddir='define'
d_rint='undef'
d_rmdir='define'
d_round='undef'
-d_sanemcmp='define'
d_sbrkproto='define'
d_scalbn='undef'
d_scalbnl='define'
diff --git a/Cross/config.sh-arm-linux-n770 b/Cross/config.sh-arm-linux-n770
index 23a1622535..fa612dae26 100644
--- a/Cross/config.sh-arm-linux-n770
+++ b/Cross/config.sh-arm-linux-n770
@@ -117,7 +117,6 @@ d_attribute_noreturn='undef'
d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
-d_bcmp='define'
d_bsd='undef'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -295,7 +294,6 @@ d_mblen='define'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
-d_memcmp='define'
d_mkdir='define'
d_mkdtemp='define'
d_mkfifo='define'
@@ -363,7 +361,6 @@ d_recvmsg='define'
d_rename='define'
d_rewinddir='define'
d_rmdir='define'
-d_sanemcmp='define'
d_sbrkproto='define'
d_scalbnl='define'
d_sched_yield='define'
diff --git a/NetWare/config.wc b/NetWare/config.wc
index 7a771430fa..d2149da91b 100644
--- a/NetWare/config.wc
+++ b/NetWare/config.wc
@@ -112,7 +112,6 @@ d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
d_backtrace='undef'
-d_bcmp='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -369,7 +368,6 @@ d_mbrtowc='undef'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
-d_memcmp='define'
d_memmem='undef'
d_memrchr='undef'
d_mkdir='define'
@@ -458,7 +456,6 @@ d_rewinddir='define'
d_rint='undef'
d_rmdir='define'
d_round='undef'
-d_sanemcmp='define'
d_sbrkproto='undef'
d_scalbn='undef'
d_scalbnl='undef'
diff --git a/NetWare/config_H.wc b/NetWare/config_H.wc
index 0d798727a5..89e0f9c0ee 100644
--- a/NetWare/config_H.wc
+++ b/NetWare/config_H.wc
@@ -50,12 +50,6 @@
#define __attribute__(_arg_)
#endif
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-/*#define HAS_BCMP /**/
-
/* HAS_CHOWN:
* This symbol, if defined, indicates that the chown routine is
* available.
@@ -283,12 +277,6 @@
*/
#define HAS_MBTOWC /**/
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#define HAS_MEMCMP /**/
-
/* HAS_MKDIR:
* This symbol, if defined, indicates that the mkdir routine is available
* to create directories. Otherwise you should fork off a new process to
@@ -1782,13 +1770,6 @@
*/
/*#define HAS_RECVMSG /**/
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
/* HAS_SBRK_PROTO:
* This symbol, if defined, indicates that the system provides
* a prototype for the sbrk() function. Otherwise, it is up
diff --git a/Porting/Glossary b/Porting/Glossary
index f5024faaf8..dbbce71194 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -495,10 +495,6 @@ d_backtrace (d_backtrace.U):
indicates to the C program that the backtrace() routine is available
to get a stack trace.
-d_bcmp (d_bcmp.U):
- This variable conditionally defines the HAS_BCMP symbol if
- the bcmp() routine is available to compare strings.
-
d_bsd (Guess.U):
This symbol conditionally defines the symbol BSD when running on a
BSD system.
@@ -1679,11 +1675,6 @@ d_memchr (d_memchr.U):
indicates to the C program that the memchr() routine is available
to locate characters within a C string.
-d_memcmp (d_memcmp.U):
- This variable conditionally defines the HAS_MEMCMP symbol, which
- indicates to the C program that the memcmp() routine is available
- to compare blocks of memory.
-
d_memmem (d_memmem.U):
This variable conditionally defines the HAS_MEMMEM symbol, which
indicates to the C program that the memmem() routine is available
@@ -2152,11 +2143,6 @@ d_round (d_round.U):
This variable conditionally defines the HAS_ROUND symbol, which
indicates to the C program that the round() routine is available.
-d_sanemcmp (d_sanemcmp.U):
- This variable conditionally defines the HAS_SANE_MEMCMP symbol if
- the memcpy() routine is available and can be used to compare relative
- magnitudes of chars with their high bits set.
-
d_sbrkproto (d_sbrkproto.U):
This variable conditionally defines the HAS_SBRK_PROTO symbol,
which indicates to the C program that the system provides
diff --git a/Porting/config.sh b/Porting/config.sh
index ed94c928b5..c3e3296db4 100644
--- a/Porting/config.sh
+++ b/Porting/config.sh
@@ -133,7 +133,6 @@ d_attribute_pure='define'
d_attribute_unused='define'
d_attribute_warn_unused_result='define'
d_backtrace='define'
-d_bcmp='define'
d_bsd='define'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -390,7 +389,6 @@ d_mbrtowc='undef'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
-d_memcmp='define'
d_memmem='define'
d_memrchr='define'
d_mkdir='define'
@@ -481,7 +479,6 @@ d_rewinddir='define'
d_rint='define'
d_rmdir='define'
d_round='define'
-d_sanemcmp='define'
d_sbrkproto='define'
d_scalbn='define'
d_scalbnl='define'
diff --git a/Porting/config_H b/Porting/config_H
index 76a206189b..73276fa84c 100644
--- a/Porting/config_H
+++ b/Porting/config_H
@@ -32,12 +32,6 @@
*/
#define HAS_ALARM /**/
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-#define HAS_BCMP /**/
-
/* HAS_CHOWN:
* This symbol, if defined, indicates that the chown routine is
* available.
@@ -248,12 +242,6 @@
*/
#define HAS_MBTOWC /**/
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#define HAS_MEMCMP /**/
-
/* HAS_MEMRCHR:
* This symbol, if defined, indicates that the memrchr routine is
* available to return a pointer to the last occurrence of a byte in
@@ -1625,13 +1613,6 @@
/*#define HAS_READDIR_R / **/
#define READDIR_R_PROTO 0 /**/
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
/* HAS_SETGRENT_R:
* This symbol, if defined, indicates that the setgrent_r routine
* is available to setgrent re-entrantly.
diff --git a/config_h.SH b/config_h.SH
index 26d4f33398..88770e7707 100755
--- a/config_h.SH
+++ b/config_h.SH
@@ -63,12 +63,6 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$d_alarm HAS_ALARM /**/
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-#$d_bcmp HAS_BCMP /**/
-
/* HAS_CBRT:
* This symbol, if defined, indicates that the cbrt() (cube root)
* function is available.
@@ -285,12 +279,6 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$d_mbtowc HAS_MBTOWC /**/
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#$d_memcmp HAS_MEMCMP /**/
-
/* HAS_MKDIR:
* This symbol, if defined, indicates that the mkdir routine is available
* to create directories. Otherwise you should fork off a new process to
@@ -1091,13 +1079,6 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$d_open3 HAS_OPEN3 /**/
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#$d_sanemcmp HAS_SANE_MEMCMP /**/
-
/* HAS_SIGACTION:
* This symbol, if defined, indicates that Vr4's sigaction() routine
* is available.
diff --git a/configure.com b/configure.com
index b91664b7f7..8a923edfa0 100644
--- a/configure.com
+++ b/configure.com
@@ -5372,7 +5372,6 @@ $ ENDIF
$ d_attribut="undef"
$ ENDIF
$!
-$ d_bcmp="define"
$ d_getitimer="define"
$ d_gettimeod="define"
$ d_mmap="define"
@@ -5984,7 +5983,6 @@ $ WC "d_attribute_warn_unused_result='undef'"
$ WC "d_prctl='undef'"
$ WC "d_prctl_set_name='undef'"
$ WC "d_printf_format_null='undef'"
-$ WC "d_bcmp='" + d_bcmp + "'"
$ WC "d_bincompat3='undef'"
$ WC "d_bsd='undef'"
$ WC "d_bsdgetpgrp='undef'"
@@ -6215,7 +6213,6 @@ $ WC "d_mbrtowc='undef'"
$ WC "d_mbstowcs='" + d_mbstowcs + "'"
$ WC "d_mbtowc='" + d_mbtowc + "'"
$ WC "d_memchr='" + d_memchr + "'"
-$ WC "d_memcmp='define'"
$ WC "d_memmem='undef'"
$ WC "d_memrchr='" + d_memrchr + "'"
$ WC "d_mkdir='define'"
@@ -6306,7 +6303,6 @@ $ WC "d_rewinddir='define'"
$ WC "d_rint='" + d_rint + "'"
$ WC "d_rmdir='define'"
$ WC "d_round='undef'"
-$ WC "d_sanemcmp='define'"
$ WC "d_sbrkproto='define'"
$ WC "d_scalbn='undef'"
$ WC "d_scalbnl='undef'"
diff --git a/embed.fnc b/embed.fnc
index f0c7f7f4df..b87c5dd80b 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1063,9 +1063,6 @@ Anp |void |atfork_lock
Anp |void |atfork_unlock
Apmb |I32 |my_lstat
pX |I32 |my_lstat_flags |NULLOK const U32 flags
-#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
-AnpP |int |my_memcmp |NN const void* vs1|NN const void* vs2|size_t len
-#endif
#if !defined(PERL_IMPLICIT_SYS)
Ap |I32 |my_pclose |NULLOK PerlIO* ptr
Ap |PerlIO*|my_popen |NN const char* cmd|NN const char* mode
diff --git a/embed.h b/embed.h
index 180ca392f3..34dd4fa415 100644
--- a/embed.h
+++ b/embed.h
@@ -779,9 +779,6 @@
#if !(defined(HAS_SIGACTION) && defined(SA_SIGINFO))
#define csighandler Perl_csighandler
#endif
-#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
-#define my_memcmp Perl_my_memcmp
-#endif
#if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
#define my_chsize(a,b) Perl_my_chsize(aTHX_ a,b)
#endif
diff --git a/ext/SDBM_File/sdbm.h b/ext/SDBM_File/sdbm.h
index adc0f95c30..1c1151ab47 100644
--- a/ext/SDBM_File/sdbm.h
+++ b/ext/SDBM_File/sdbm.h
@@ -204,42 +204,12 @@ Free_t Perl_mfree proto((Malloc_t where));
#define memzero(d,l) memset(d,0,l)
-#if defined(mips) && defined(ultrix) && !defined(__STDC__)
-# undef HAS_MEMCMP
+#ifdef BUGGY_MSC
+# pragma function(memcmp)
#endif
-#if defined(HAS_MEMCMP) && defined(HAS_SANE_MEMCMP)
-# if !defined(STANDARD_C) && !defined(I_STRING) && !defined(I_MEMORY)
-# ifndef memcmp
- extern int memcmp proto((char*, char*, int));
-# endif
-# endif
-# ifdef BUGGY_MSC
-# pragma function(memcmp)
-# endif
-#else
-# ifndef memcmp
- /* maybe we should have included the full embedding header... */
-# define memcmp Perl_my_memcmp
-#ifndef __cplusplus
- extern int memcmp proto((char*, char*, int));
-#endif
-# endif
-#endif /* HAS_MEMCMP */
-
-#ifndef HAS_BCMP
-# ifndef bcmp
-# define bcmp(s1,s2,l) memcmp(s1,s2,l)
-# endif
-#endif /* !HAS_BCMP */
-
-#ifdef HAS_MEMCMP
-# define memNE(s1,s2,l) (memcmp(s1,s2,l))
-# define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
-#else
-# define memNE(s1,s2,l) (bcmp(s1,s2,l))
-# define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
-#endif
+#define memNE(s1,s2,l) (memcmp(s1,s2,l))
+#define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
#ifdef I_NETINET_IN
# ifdef VMS
diff --git a/handy.h b/handy.h
index 0f31e57218..446dba97e0 100644
--- a/handy.h
+++ b/handy.h
@@ -493,13 +493,8 @@ Returns zero if non-equal, or non-zero if equal.
#define strEQs(s1,s2) (!strncmp(s1,"" s2 "", sizeof(s2)-1))
#endif
-#ifdef HAS_MEMCMP
-# define memNE(s1,s2,l) (memcmp(s1,s2,l))
-# define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
-#else
-# define memNE(s1,s2,l) (bcmp(s1,s2,l))
-# define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
-#endif
+#define memNE(s1,s2,l) (memcmp(s1,s2,l))
+#define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
/* memEQ and memNE where second comparand is a string constant */
#define memEQs(s1, l, s2) \
diff --git a/hints/epix.sh b/hints/epix.sh
index 14b56adaa8..8967f03c86 100644
--- a/hints/epix.sh
+++ b/hints/epix.sh
@@ -55,7 +55,6 @@ libswanted=`echo " $libswanted " | sed -e 's/ malloc / /'` # -e 's/ ucb / /'`
# it is needed for ODBM_File and NDBM_File extensions.
if [ -r /usr/ucblib/libucb.a ]; then # If using BSD-compat. library:
# Use the "native" counterparts, not the BSD emulation stuff:
- d_bcmp='undef';
d_index='undef'; d_killpg='undef'; d_getprior='undef'; d_setprior='undef'
d_setlinebuf='undef'; d_setregid='undef'; d_setreuid='undef'
fi
diff --git a/hints/svr4.sh b/hints/svr4.sh
index 80fc9a98d6..756dfcdc5b 100644
--- a/hints/svr4.sh
+++ b/hints/svr4.sh
@@ -25,7 +25,6 @@ libswanted=`echo " $libswanted " | sed -e 's/ malloc / /'` # -e 's/ ucb / /'`
if [ -r /usr/ucblib/libucb.a ]; then # If using BSD-compat. library:
gconvert_preference='gcvt sprintf' # Try gcvt() before gconvert().
# Use the "native" counterparts, not the BSD emulation stuff:
- d_bcmp='undef'
d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
d_setlinebuf='undef'
# d_setregid='undef' d_setreuid='undef' # ???
diff --git a/hints/svr5.sh b/hints/svr5.sh
index aeb673ac38..45a8b71519 100644
--- a/hints/svr5.sh
+++ b/hints/svr5.sh
@@ -92,7 +92,6 @@ glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /'`
# Don't use BSD emulation pieces (/usr/ucblib) regardless
# these would probably be autonondetected anyway but ...
gconvert_preference='gcvt sprintf' # Try gcvt() before gconvert().
-d_bcmp='undef'
d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
d_setlinebuf='undef'
d_setregid='undef' d_setreuid='undef' # -- in /usr/lib/libc.so.1
diff --git a/perl.h b/perl.h
index fe2597669f..fd0c222d63 100644
--- a/perl.h
+++ b/perl.h
@@ -1001,21 +1001,6 @@ EXTERN_C int usleep(unsigned int);
# include <memory.h>
#endif
-#if defined(mips) && defined(ultrix) && !defined(__STDC__)
-# undef HAS_MEMCMP
-#endif
-
-#if defined(HAS_MEMCMP) && defined(HAS_SANE_MEMCMP)
-# if !defined(STANDARD_C) && !defined(I_STRING) && !defined(I_MEMORY)
-# ifndef memcmp
- extern int memcmp (char*, char*, int);
-# endif
-# endif
-#else
-# undef memcmp
-# define memcmp my_memcmp
-#endif /* HAS_MEMCMP && HAS_SANE_MEMCMP */
-
#ifndef memzero
# define memzero(d,l) memset(d,0,l)
#endif
@@ -1028,12 +1013,6 @@ EXTERN_C int usleep(unsigned int);
#endif
#endif
-#ifndef HAS_BCMP
-# ifndef bcmp
-# define bcmp(s1,s2,l) memcmp(s1,s2,l)
-# endif
-#endif /* !HAS_BCMP */
-
#ifdef I_NETINET_IN
# include <netinet/in.h>
#endif
diff --git a/plan9/config.plan9 b/plan9/config.plan9
index 8ae0aff630..8a2706766d 100644
--- a/plan9/config.plan9
+++ b/plan9/config.plan9
@@ -92,12 +92,6 @@
#define __attribute__(_arg_)
#endif
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-#define HAS_BCMP /**/
-
/* HAS_CHOWN:
* This symbol, if defined, indicates that the chown routine is
* available.
@@ -307,12 +301,6 @@
*/
#define HAS_MBTOWC /**/
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#define HAS_MEMCMP /**/
-
/* HAS_MKDIR:
* This symbol, if defined, indicates that the mkdir routine is available
* to create directories. Otherwise you should fork off a new process to
@@ -2115,13 +2103,6 @@
*/
/*#define HAS_RECVMSG / **/
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
/* HAS_SBRK_PROTO:
* This symbol, if defined, indicates that the system provides
* a prototype for the sbrk() function. Otherwise, it is up
diff --git a/plan9/config_h.sample b/plan9/config_h.sample
index 902eba465b..d288411f96 100644
--- a/plan9/config_h.sample
+++ b/plan9/config_h.sample
@@ -50,12 +50,6 @@
#define __attribute__(_arg_)
#endif
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-#define HAS_BCMP /**/
-
/* HAS_CHOWN:
* This symbol, if defined, indicates that the chown routine is
* available.
@@ -265,12 +259,6 @@
*/
#define HAS_MBTOWC /**/
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#define HAS_MEMCMP /**/
-
/* HAS_MKDIR:
* This symbol, if defined, indicates that the mkdir routine is available
* to create directories. Otherwise you should fork off a new process to
@@ -2068,13 +2056,6 @@
*/
/*#define HAS_RECVMSG / **/
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
/* HAS_SBRK_PROTO:
* This symbol, if defined, indicates that the system provides
* a prototype for the sbrk() function. Otherwise, it is up
diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample
index 3f10f59d53..485a66238f 100644
--- a/plan9/config_sh.sample
+++ b/plan9/config_sh.sample
@@ -125,7 +125,6 @@ d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
d_backtrace='undef'
-d_bcmp='define'
d_bsd='undef'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -380,7 +379,6 @@ d_mbrtowc='undef'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
-d_memcmp='define'
d_memmem='undef'
d_memrchr='undef'
d_mkdir='define'
@@ -469,7 +467,6 @@ d_rewinddir='define'
d_rint='undef'
d_rmdir='define'
d_round='undef'
-d_sanemcmp='define'
d_sbrkproto='undef'
d_scalbn='undef'
d_scalbnl='undef'
diff --git a/proto.h b/proto.h
index fb36ae8229..4e5021ccd0 100644
--- a/proto.h
+++ b/proto.h
@@ -3827,14 +3827,6 @@ PERL_CALLCONV char* Perl_getenv_len(pTHX_ const char *env_elem, unsigned long *l
#define PERL_ARGS_ASSERT_GETENV_LEN \
assert(env_elem); assert(len)
#endif
-#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
-PERL_CALLCONV int Perl_my_memcmp(const void* vs1, const void* vs2, size_t len)
- __attribute__warn_unused_result__
- __attribute__pure__;
-#define PERL_ARGS_ASSERT_MY_MEMCMP \
- assert(vs1); assert(vs2)
-
-#endif
#if !defined(HAS_MKDIR) || !defined(HAS_RMDIR)
# if defined(PERL_IN_PP_SYS_C)
STATIC int S_dooneliner(pTHX_ const char *cmd, const char *filename)
diff --git a/symbian/config.sh b/symbian/config.sh
index d980747a00..f33d6572a4 100644
--- a/symbian/config.sh
+++ b/symbian/config.sh
@@ -69,7 +69,6 @@ d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
d_backtrace='undef'
-d_bcmp='undef'
d_bsd='undef'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -326,7 +325,6 @@ d_mbrtowc='undef'
d_mbstowcs='undef'
d_mbtowc='undef'
d_memchr='define'
-d_memcmp='define'
d_memmem='undef'
d_memrchr='undef'
d_mkdir='define'
@@ -415,7 +413,6 @@ d_rewinddir='define'
d_rint='undef'
d_rmdir='define'
d_round='undef'
-d_sanemcmp='undef'
d_sbrkproto='undef'
d_scalbn='undef'
d_scalbnl='undef'
diff --git a/uconfig.h b/uconfig.h
index be77505cb3..cc6879068a 100644
--- a/uconfig.h
+++ b/uconfig.h
@@ -28,12 +28,6 @@
*/
/*#define HAS_ALARM / **/
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-/*#define HAS_BCMP / **/
-
/* HAS_CBRT:
* This symbol, if defined, indicates that the cbrt() (cube root)
* function is available.
@@ -250,12 +244,6 @@
*/
/*#define HAS_MBTOWC / **/
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#define HAS_MEMCMP /**/
-
/* HAS_MKDIR:
* This symbol, if defined, indicates that the mkdir routine is available
* to create directories. Otherwise you should fork off a new process to
@@ -1056,13 +1044,6 @@
*/
/*#define HAS_OPEN3 / **/
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-/*#define HAS_SANE_MEMCMP / **/
-
/* HAS_SIGACTION:
* This symbol, if defined, indicates that Vr4's sigaction() routine
* is available.
@@ -5391,6 +5372,6 @@
#endif
/* Generated from:
- * 1cf368f3ea2fec4f94f386fdea4cdeeaa97c85016d4890593bf9f9883b0efddd config_h.SH
- * 0aaf1bf7863e3a8c2c9ebd5150ba593f980e174203d159deac8f83b981da6037 uconfig.sh
+ * 53d2d4cc7acf8d0b0b04606f10f9ad2405b078be305d3ad5e57aa2fa5954c9d6 config_h.SH
+ * da0fc52cf0e7a996baafbaa4d6cfaa06229ec4a84f23e80dfdbf97d4e73eb2c8 uconfig.sh
* ex: set ro: */
diff --git a/uconfig.sh b/uconfig.sh
index 61708e6b77..c60abcfaf8 100644
--- a/uconfig.sh
+++ b/uconfig.sh
@@ -63,7 +63,6 @@ d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
d_backtrace='undef'
-d_bcmp='undef'
d_bsd='undef'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -319,7 +318,6 @@ d_mbrtowc='undef'
d_mbstowcs='undef'
d_mbtowc='undef'
d_memchr='define'
-d_memcmp='define'
d_memmem='undef'
d_memrchr='undef'
d_mkdir='undef'
@@ -408,7 +406,6 @@ d_rewinddir='undef'
d_rint='undef'
d_rmdir='undef'
d_round='undef'
-d_sanemcmp='undef'
d_sbrkproto='undef'
d_scalbn='undef'
d_scalbnl='undef'
diff --git a/uconfig64.sh b/uconfig64.sh
index 108719e3b6..1489d722d2 100644
--- a/uconfig64.sh
+++ b/uconfig64.sh
@@ -64,7 +64,6 @@ d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
d_backtrace='undef'
-d_bcmp='undef'
d_bsd='undef'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -320,7 +319,6 @@ d_mbrtowc='undef'
d_mbstowcs='undef'
d_mbtowc='undef'
d_memchr='define'
-d_memcmp='define'
d_memmem='undef'
d_memrchr='undef'
d_mkdir='undef'
@@ -409,7 +407,6 @@ d_rewinddir='undef'
d_rint='undef'
d_rmdir='undef'
d_round='undef'
-d_sanemcmp='undef'
d_sbrkproto='undef'
d_scalbn='undef'
d_scalbnl='undef'
diff --git a/util.c b/util.c
index 488a4249e5..fd2d306aeb 100644
--- a/util.c
+++ b/util.c
@@ -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
diff --git a/win32/config.ce b/win32/config.ce
index 252253d55b..446f24c689 100644
--- a/win32/config.ce
+++ b/win32/config.ce
@@ -110,7 +110,6 @@ d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
d_backtrace='undef'
-d_bcmp='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -367,7 +366,6 @@ d_mbrtowc='undef'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
-d_memcmp='define'
d_memmem='undef'
d_memrchr='undef'
d_mkdir='define'
@@ -456,7 +454,6 @@ d_rewinddir='define'
d_rint='undef'
d_rmdir='define'
d_round='undef'
-d_sanemcmp='define'
d_sbrkproto='undef'
d_scalbn='undef'
d_scalbnl='undef'
diff --git a/win32/config.gc b/win32/config.gc
index 1485088daf..fbb315baff 100644
--- a/win32/config.gc
+++ b/win32/config.gc
@@ -112,7 +112,6 @@ d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
d_backtrace='undef'
-d_bcmp='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -367,7 +366,6 @@ d_mbrtowc='undef'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
-d_memcmp='define'
d_memmem='undef'
d_memrchr='undef'
d_mkdir='define'
@@ -457,7 +455,6 @@ d_rewinddir='define'
d_rint='undef'
d_rmdir='define'
d_round='undef'
-d_sanemcmp='define'
d_sbrkproto='undef'
d_scalbn='undef'
d_scalbnl='undef'
diff --git a/win32/config.vc b/win32/config.vc
index ce9b8986fc..d51d500f75 100644
--- a/win32/config.vc
+++ b/win32/config.vc
@@ -112,7 +112,6 @@ d_attribute_pure='undef'
d_attribute_unused='undef'
d_attribute_warn_unused_result='undef'
d_backtrace='undef'
-d_bcmp='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
d_bsdsetpgrp='undef'
@@ -367,7 +366,6 @@ d_mbrtowc='undef'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
-d_memcmp='define'
d_memmem='undef'
d_memrchr='undef'
d_mkdir='define'
@@ -457,7 +455,6 @@ d_rewinddir='define'
d_rint='undef'
d_rmdir='define'
d_round='undef'
-d_sanemcmp='define'
d_sbrkproto='undef'
d_scalbn='undef'
d_scalbnl='undef'
diff --git a/win32/config_H.ce b/win32/config_H.ce
index 828b556fc7..31af04d635 100644
--- a/win32/config_H.ce
+++ b/win32/config_H.ce
@@ -32,12 +32,6 @@
*/
/*#define HAS_ALARM /**/
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-/*#define HAS_BCMP /**/
-
/* HAS_CHOWN:
* This symbol, if defined, indicates that the chown routine is
* available.
@@ -247,12 +241,6 @@
*/
#define HAS_MBTOWC /**/
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#define HAS_MEMCMP /**/
-
/* HAS_MKDIR:
* This symbol, if defined, indicates that the mkdir routine is available
* to create directories. Otherwise you should fork off a new process to
@@ -2070,13 +2058,6 @@
*/
/*#define HAS_RECVMSG /**/
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
/* HAS_SBRK_PROTO:
* This symbol, if defined, indicates that the system provides
* a prototype for the sbrk() function. Otherwise, it is up
diff --git a/win32/config_H.gc b/win32/config_H.gc
index 6672dbba1b..e49124a748 100644
--- a/win32/config_H.gc
+++ b/win32/config_H.gc
@@ -28,12 +28,6 @@
*/
#define HAS_ALARM /**/
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-/*#define HAS_BCMP / **/
-
/* HAS_CBRT:
* This symbol, if defined, indicates that the cbrt() (cube root)
* function is available.
@@ -250,12 +244,6 @@
*/
#define HAS_MBTOWC /**/
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#define HAS_MEMCMP /**/
-
/* HAS_MKDIR:
* This symbol, if defined, indicates that the mkdir routine is available
* to create directories. Otherwise you should fork off a new process to
@@ -1044,13 +1032,6 @@
*/
/*#define HAS_OPEN3 / **/
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
/* HAS_SIGACTION:
* This symbol, if defined, indicates that Vr4's sigaction() routine
* is available.
diff --git a/win32/config_H.vc b/win32/config_H.vc
index ff0f0d794b..3691588015 100644
--- a/win32/config_H.vc
+++ b/win32/config_H.vc
@@ -28,12 +28,6 @@
*/
#define HAS_ALARM /**/
-/* HAS_BCMP:
- * This symbol is defined if the bcmp() routine is available to
- * compare blocks of memory.
- */
-/*#define HAS_BCMP / **/
-
/* HAS_CBRT:
* This symbol, if defined, indicates that the cbrt() (cube root)
* function is available.
@@ -250,12 +244,6 @@
*/
#define HAS_MBTOWC /**/
-/* HAS_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * to compare blocks of memory.
- */
-#define HAS_MEMCMP /**/
-
/* HAS_MKDIR:
* This symbol, if defined, indicates that the mkdir routine is available
* to create directories. Otherwise you should fork off a new process to
@@ -1044,13 +1032,6 @@
*/
/*#define HAS_OPEN3 / **/
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
/* HAS_SIGACTION:
* This symbol, if defined, indicates that Vr4's sigaction() routine
* is available.