From 6b6e686b23214ef37c30d5e1568156ba18e76f29 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Wed, 5 Oct 2022 12:08:31 +0200 Subject: [PATCH] include: Adjust arc4random() per glibc adoption Some arc4random functions were added in glibc 2.36. Signed-off-by: Callum Farmer Signed-off-by: Guillem Jover --- include/bsd/stdlib.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h index f7bcbd0..ac60dc6 100644 --- a/include/bsd/stdlib.h +++ b/include/bsd/stdlib.h @@ -51,11 +51,15 @@ #include __BEGIN_DECLS +#if !defined(__GLIBC__) || \ + !__GLIBC_PREREQ(2, 36) || \ + !defined(_DEFAULT_SOURCE) uint32_t arc4random(void); -void arc4random_stir(void); -void arc4random_addrandom(unsigned char *dat, int datlen); void arc4random_buf(void *_buf, size_t n); uint32_t arc4random_uniform(uint32_t upper_bound); +#endif +void arc4random_stir(void); +void arc4random_addrandom(unsigned char *dat, int datlen); int dehumanize_number(const char *str, int64_t *size); -- 2.47.3