]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
include: Adjust arc4random() per glibc adoption
authorCallum Farmer <gmbr3@opensuse.org>
Wed, 5 Oct 2022 10:08:31 +0000 (12:08 +0200)
committerGuillem Jover <guillem@hadrons.org>
Wed, 5 Oct 2022 10:31:49 +0000 (12:31 +0200)
Some arc4random functions were added in glibc 2.36.

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
include/bsd/stdlib.h

index f7bcbd0913d8e6d31d99644414f797f4cb7a012b..ac60dc6e51d3f9343f1668d303b0f33c54208e3e 100644 (file)
 #include <stdint.h>
 
 __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);