build with libbsd-overlay

Simplifies the code. Upstream also recommends it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2022-08-11 20:57:32 -07:00 committed by Nathan Moinvaziri
parent 7b2784110f
commit 387ade34c6
2 changed files with 2 additions and 6 deletions

View file

@ -527,7 +527,7 @@ if(UNIX)
if(MZ_LIBBSD AND NOT HAVE_ARC4RANDOM_BUF)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBBSD libbsd)
pkg_check_modules(LIBBSD libbsd-overlay)
if(LIBBSD_FOUND)
check_library_exists("${LIBBSD_LIBRARIES}" "arc4random_buf"
"${LIBBSD_LIBRARY_DIRS}" HAVE_LIBBSD_ARC4RANDOM_BUF)

View file

@ -34,11 +34,7 @@
# include <sys/random.h>
#endif
#if defined(HAVE_LIBBSD)
# include <sys/types.h>
# ifndef __u_char_defined
typedef unsigned char u_char;
# endif
# include <bsd/stdlib.h> /* arc4random_buf */
# include <stdlib.h> /* arc4random_buf */
#endif
/***************************************************************************/