Check for bzero and supply if needed.

Since explicit_bzero uses it via an indirect it needs to be a function
not just a macro.
This commit is contained in:
Darren Tucker 2018-02-24 20:25:22 +11:00
parent 1a348359e4
commit a9004425a0
3 changed files with 15 additions and 0 deletions

View File

@ -1695,6 +1695,7 @@ AC_CHECK_FUNCS([ \
bcrypt_pbkdf \
bindresvport_sa \
blf_enc \
bzero \
cap_rights_limit \
clock \
closefrom \
@ -1800,6 +1801,8 @@ AC_CHECK_FUNCS([ \
warn \
])
AC_CHECK_DECLS([bzero])
dnl Wide character support.
AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth])

View File

@ -282,3 +282,11 @@ llabs(long long j)
return (j < 0 ? -j : j);
}
#endif
#ifndef HAVE_BZERO
void
bzero(void *b, size_t n)
{
(void)memset(b, 0, n);
}
#endif

View File

@ -133,4 +133,8 @@ void warn(const char *, ...) __attribute__((format(printf, 1, 2)));
long long llabs(long long);
#endif
#ifndef HAVE_DECL_BZERO
void bzero(void *, size_t);
#endif
#endif /* _BSD_MISC_H */