Commit d3ec4856 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

ITS#3583: memcmp replacement compilation error fix

parent b914aee9
......@@ -24015,13 +24015,21 @@ fi
echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
if test $ac_cv_func_memcmp_clean = no ; then
cat >> confdefs.h <<\EOF
#define NEED_MEMCMP_REPLACEMENT 1
EOF
fi
echo $ac_n "checking for strftime""... $ac_c" 1>&6
echo "configure:24020: checking for strftime" >&5
echo "configure:24028: checking for strftime" >&5
if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24025 "configure"
#line 24033 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strftime(); below. */
......@@ -24045,7 +24053,7 @@ f = strftime;
 
; return 0; }
EOF
if { (eval echo configure:24049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_strftime=yes"
else
......@@ -24067,7 +24075,7 @@ else
echo "$ac_t""no" 1>&6
# strftime is in -lintl on SCO UNIX.
echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
echo "configure:24071: checking for strftime in -lintl" >&5
echo "configure:24079: checking for strftime in -lintl" >&5
ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -24075,7 +24083,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 24079 "configure"
#line 24087 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
......@@ -24086,7 +24094,7 @@ int main() {
strftime()
; return 0; }
EOF
if { (eval echo configure:24090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
......@@ -24114,12 +24122,12 @@ fi
 
 
echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
echo "configure:24118: checking for inet_aton()" >&5
echo "configure:24126: checking for inet_aton()" >&5
if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24123 "configure"
#line 24131 "configure"
#include "confdefs.h"
 
#ifdef HAVE_SYS_TYPES_H
......@@ -24141,7 +24149,7 @@ struct in_addr in;
int rc = inet_aton( "255.255.255.255", &in );
; return 0; }
EOF
if { (eval echo configure:24145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ol_cv_func_inet_aton=yes
else
......@@ -24163,12 +24171,12 @@ EOF
 
echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
echo "configure:24167: checking for _spawnlp" >&5
echo "configure:24175: checking for _spawnlp" >&5
if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24172 "configure"
#line 24180 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _spawnlp(); below. */
......@@ -24192,7 +24200,7 @@ f = _spawnlp;
 
; return 0; }
EOF
if { (eval echo configure:24196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__spawnlp=yes"
else
......@@ -24216,12 +24224,12 @@ fi
 
 
echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
echo "configure:24220: checking for _snprintf" >&5
echo "configure:24228: checking for _snprintf" >&5
if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24225 "configure"
#line 24233 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _snprintf(); below. */
......@@ -24245,7 +24253,7 @@ f = _snprintf;
 
; return 0; }
EOF
if { (eval echo configure:24249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__snprintf=yes"
else
......@@ -24271,12 +24279,12 @@ fi
 
 
echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
echo "configure:24275: checking for _vsnprintf" >&5
echo "configure:24283: checking for _vsnprintf" >&5
if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24280 "configure"
#line 24288 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _vsnprintf(); below. */
......@@ -24300,7 +24308,7 @@ f = _vsnprintf;
 
; return 0; }
EOF
if { (eval echo configure:24304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__vsnprintf=yes"
else
......@@ -24326,12 +24334,12 @@ fi
 
 
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
echo "configure:24330: checking for vprintf" >&5
echo "configure:24338: checking for vprintf" >&5
if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24335 "configure"
#line 24343 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
......@@ -24355,7 +24363,7 @@ f = vprintf;
 
; return 0; }
EOF
if { (eval echo configure:24359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
......@@ -24379,12 +24387,12 @@ fi
 
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
echo "configure:24383: checking for _doprnt" >&5
echo "configure:24391: checking for _doprnt" >&5
if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24388 "configure"
#line 24396 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
......@@ -24408,7 +24416,7 @@ f = _doprnt;
 
; return 0; }
EOF
if { (eval echo configure:24412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
......@@ -24437,12 +24445,12 @@ if test $ac_cv_func_vprintf = yes ; then
for ac_func in snprintf vsnprintf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:24441: checking for $ac_func" >&5
echo "configure:24449: checking for $ac_func" >&5
if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24446 "configure"
#line 24454 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
......@@ -24466,7 +24474,7 @@ f = $ac_func;
 
; return 0; }
EOF
if { (eval echo configure:24470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
......@@ -24549,12 +24557,12 @@ for ac_func in \
 
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:24553: checking for $ac_func" >&5
echo "configure:24561: checking for $ac_func" >&5
if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24558 "configure"
#line 24566 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
......@@ -24578,7 +24586,7 @@ f = $ac_func;
 
; return 0; }
EOF
if { (eval echo configure:24582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
......@@ -24606,12 +24614,12 @@ done
for ac_func in getopt getpeereid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:24610: checking for $ac_func" >&5
echo "configure:24618: checking for $ac_func" >&5
if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24615 "configure"
#line 24623 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
......@@ -24635,7 +24643,7 @@ f = $ac_func;
 
; return 0; }
EOF
if { (eval echo configure:24639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
......@@ -24667,19 +24675,19 @@ if test "$ac_cv_func_getopt" != yes; then
fi
if test "$ac_cv_func_getpeereid" != yes; then
echo $ac_n "checking for msg_accrights in msghdr""... $ac_c" 1>&6
echo "configure:24671: checking for msg_accrights in msghdr" >&5
echo "configure:24679: checking for msg_accrights in msghdr" >&5
if eval "test \"\${ol_cv_msghdr_msg_accrights+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24676 "configure"
#line 24684 "configure"
#include "confdefs.h"
#include <sys/socket.h>
int main() {
struct msghdr m; m.msg_accrightslen=0
; return 0; }
EOF
if { (eval echo configure:24683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:24691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ol_cv_msghdr_msg_accrights=yes
else
......@@ -24723,17 +24731,17 @@ if test "$ol_enable_slapi" != no ; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:24727: checking for $ac_hdr" >&5
echo "configure:24735: checking for $ac_hdr" >&5
if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 24732 "configure"
#line 24740 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:24737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:24745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -24764,7 +24772,7 @@ done
{ echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
fi
echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
echo "configure:24768: checking for lt_dlinit in -lltdl" >&5
echo "configure:24776: checking for lt_dlinit in -lltdl" >&5
ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -24772,7 +24780,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lltdl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 24776 "configure"
#line 24784 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
......@@ -24783,7 +24791,7 @@ int main() {
lt_dlinit()
; return 0; }
EOF
if { (eval echo configure:24787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
......
......@@ -2422,6 +2422,12 @@ AC_DEFINE(LBER_TAG_T,long)
dnl ----------------------------------------------------------------
dnl Checks for library functions.
AC_FUNC_MEMCMP
if test $ac_cv_func_memcmp_clean = no ; then
AC_DEFINE(NEED_MEMCMP_REPLACEMENT,1,
[define if memcmp is not 8-bit clean or is otherwise broken])
fi
dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
AC_FUNC_STRFTIME
dnl AM_FUNC_STRTOD
......
......@@ -89,6 +89,11 @@ int (strncasecmp)();
else AC_MEMCPY( (d), (s), (n) ); \
} while(0)
#ifdef NEED_MEMCMP_REPLACEMENT
int (lutil_memcmp)(const void *b1, const void *b2, size_t len);
#define memcmp lutil_memcmp
#endif
#define STRLENOF(s) (sizeof(s)-1)
#if defined( HAVE_NONPOSIX_STRERROR_R )
......
......@@ -926,6 +926,9 @@
/* The number of bytes in type wchar_t */
#undef SIZEOF_WCHAR_T
/* define if memcmp is not 8-bit clean or is otherwise broken */
#undef NEED_MEMCMP_REPLACEMENT
/* define to you inet_aton(3) is available */
#undef HAVE_INET_ATON
......
......@@ -21,14 +21,13 @@
* Memory Compare
*/
int
(memcmp)(const void *v1, const void *v2, int n)
(lutil_memcmp)(const void *v1, const void *v2, size_t n)
{
if (n != 0) {
const unsigned char *s1=v1, *s2=v2;
do {
if (*s1++ != *s2++)
return (*--s1 - *--s2);
if (*s1++ != *s2++) return *--s1 - *--s2;
} while (--n != 0);
}
return (0);
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment