Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
d3ec4856
Commit
d3ec4856
authored
Mar 05, 2005
by
Kurt Zeilenga
Browse files
ITS#3583: memcmp replacement compilation error fix
parent
b914aee9
Changes
5
Hide whitespace changes
Inline
Side-by-side
configure
View file @
d3ec4856
...
...
@@ -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:2402
0
: checking for strftime" >&5
echo "configure:2402
8
: 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 240
25
"configure"
#line 240
33
"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:240
49
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:240
57
: \"$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:2407
1
: checking for strftime in -lintl" >&5
echo "configure:2407
9
: 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 2407
9
"configure"
#line 240
8
7 "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:2409
0
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2409
8
: \"$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:241
18
: checking for inet_aton()" >&5
echo "configure:241
26
: 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 241
2
3 "configure"
#line 2413
1
"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:241
4
5: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2415
3
: \"$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:241
6
7: checking for _spawnlp" >&5
echo "configure:2417
5
: 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 241
72
"configure"
#line 241
80
"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:24
196
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:24
204
: \"$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:2422
0
: checking for _snprintf" >&5
echo "configure:2422
8
: 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 242
25
"configure"
#line 242
33
"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:242
49
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:242
57
: \"$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:242
75
: checking for _vsnprintf" >&5
echo "configure:242
83
: 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 2428
0
"configure"
#line 2428
8
"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:243
04
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:243
12
: \"$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:2433
0
: checking for vprintf" >&5
echo "configure:2433
8
: 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 2433
5
"configure"
#line 243
4
3 "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:243
59
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:243
67
: \"$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:243
83
: checking for _doprnt" >&5
echo "configure:243
91
: 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 243
88
"configure"
#line 243
96
"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:244
1
2: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2442
0
: \"$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:2444
1
: checking for $ac_func" >&5
echo "configure:2444
9
: 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 2444
6
"configure"
#line 244
5
4 "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:2447
0
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2447
8
: \"$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:245
53
: checking for $ac_func" >&5
echo "configure:245
61
: 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 245
58
"configure"
#line 245
66
"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:245
82
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:245
90
: \"$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:2461
0
: checking for $ac_func" >&5
echo "configure:2461
8
: 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 246
15
"configure"
#line 246
23
"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:246
39
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:246
47
: \"$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:2467
1
: checking for msg_accrights in msghdr" >&5
echo "configure:2467
9
: 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 246
76
"configure"
#line 246
84
"configure"
#include "confdefs.h"
#include <sys/socket.h>
int main() {
struct msghdr m; m.msg_accrightslen=0
; return 0; }
EOF
if { (eval echo configure:246
83
: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:246
91
: \"$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:247
27
: checking for $ac_hdr" >&5
echo "configure:247
35
: 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 247
32
"configure"
#line 247
40
"configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:247
37
: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:247
45
: \"$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:2476
8
: checking for lt_dlinit in -lltdl" >&5
echo "configure:247
7
6: 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 247
76
"configure"
#line 247
84
"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:247
87
: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:247
95
: \"$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
...
...
configure.in
View file @
d3ec4856
...
...
@@ -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
...
...
include/ac/string.h
View file @
d3ec4856
...
...
@@ -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 )
...
...
include/portable.h.in
View file @
d3ec4856
...
...
@@ -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
...
...
libraries/liblutil/memcmp.c
View file @
d3ec4856
...
...
@@ -21,14 +21,13 @@
* Memory Compare
*/
int
(
memcmp
)(
const
void
*
v1
,
const
void
*
v2
,
in
t
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
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment