mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- Fix to define _OPENBSD_SOURCE to get reallocarray on NetBSD.
This commit is contained in:
parent
a03f0a388e
commit
14b11384a4
4 changed files with 48 additions and 8 deletions
|
|
@ -413,7 +413,7 @@
|
|||
/* Define to 1 if you have the `RAND_cleanup' function. */
|
||||
#undef HAVE_RAND_CLEANUP
|
||||
|
||||
/* Define to 1 if you have the `reallocarray' function. */
|
||||
/* If we have reallocarray(3) */
|
||||
#undef HAVE_REALLOCARRAY
|
||||
|
||||
/* Define to 1 if you have the `recvmsg' function. */
|
||||
|
|
|
|||
34
configure
vendored
34
configure
vendored
|
|
@ -20144,20 +20144,42 @@ fi
|
|||
|
||||
LIBOBJ_WITHOUT_CTIMEARC4="$LIBOBJS"
|
||||
|
||||
ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray"
|
||||
if test "x$ac_cv_func_reallocarray" = xyes; then :
|
||||
$as_echo "#define HAVE_REALLOCARRAY 1" >>confdefs.h
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for reallocarray" >&5
|
||||
$as_echo_n "checking for reallocarray... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$ac_includes_default
|
||||
|
||||
#define _OPENBSD_SOURCE 1
|
||||
#include <stdlib.h>
|
||||
int main(void) {
|
||||
void* p = reallocarray(NULL, 10, 100);
|
||||
free(p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
$as_echo "#define HAVE_REALLOCARRAY 1" >>confdefs.h
|
||||
|
||||
|
||||
else
|
||||
case " $LIBOBJS " in
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
case " $LIBOBJS " in
|
||||
*" reallocarray.$ac_objext "* ) ;;
|
||||
*) LIBOBJS="$LIBOBJS reallocarray.$ac_objext"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
if test "$USE_NSS" = "no"; then
|
||||
ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random"
|
||||
if test "x$ac_cv_func_arc4random" = xyes; then :
|
||||
|
|
|
|||
17
configure.ac
17
configure.ac
|
|
@ -1447,7 +1447,22 @@ AC_REPLACE_FUNCS(explicit_bzero)
|
|||
dnl without CTIME, ARC4-functions and without reallocarray.
|
||||
LIBOBJ_WITHOUT_CTIMEARC4="$LIBOBJS"
|
||||
AC_SUBST(LIBOBJ_WITHOUT_CTIMEARC4)
|
||||
AC_REPLACE_FUNCS(reallocarray)
|
||||
AC_MSG_CHECKING([for reallocarray])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE(AC_INCLUDES_DEFAULT
|
||||
[[
|
||||
#define _OPENBSD_SOURCE 1
|
||||
#include <stdlib.h>
|
||||
int main(void) {
|
||||
void* p = reallocarray(NULL, 10, 100);
|
||||
free(p);
|
||||
return 0;
|
||||
}
|
||||
]])], [AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REALLOCARRAY, 1, [If we have reallocarray(3)])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_LIBOBJ(reallocarray)
|
||||
])
|
||||
if test "$USE_NSS" = "no"; then
|
||||
AC_REPLACE_FUNCS(arc4random)
|
||||
AC_REPLACE_FUNCS(arc4random_uniform)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
28 May 2019: Wouter
|
||||
- Fix to define _OPENBSD_SOURCE to get reallocarray on NetBSD.
|
||||
|
||||
27 May 2019: Wouter
|
||||
- Fix double file close in tcp pipelined response code.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue