1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Add strlcat() from OpenBSD, to be used for replacing strncat and other

strange coding practices.
This commit is contained in:
Peter Eisentraut
2007-02-07 00:28:55 +00:00
parent 5b706ba481
commit 4f64a07bee
6 changed files with 144 additions and 7 deletions

73
configure vendored
View File

@ -13973,6 +13973,76 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking whether strlcat is declared" >&5
echo $ECHO_N "checking whether strlcat is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_strlcat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
#ifndef strlcat
char *p = (char *) strlcat;
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_have_decl_strlcat=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_decl_strlcat=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcat" >&5
echo "${ECHO_T}$ac_cv_have_decl_strlcat" >&6
if test $ac_cv_have_decl_strlcat = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRLCAT 1
_ACEOF
else
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STRLCAT 0
_ACEOF
fi
echo "$as_me:$LINENO: checking whether strlcpy is declared" >&5
echo $ECHO_N "checking whether strlcpy is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_strlcpy+set}" = set; then
@ -14850,7 +14920,8 @@ LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
for ac_func in crypt fseeko getopt getrusage inet_aton random rint srandom strdup strerror strlcpy strtol strtoul unsetenv
for ac_func in crypt fseeko getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul unsetenv
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5