From e03b2c5c9de78a026da6d7040b03e688ea8dc80b Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 7 Jul 2023 12:02:14 +0200 Subject: [PATCH] Fix build: put chacha_private.h into _SOURCES Also fix redundant declaration warnings Followup to #12999 --- ext/arc4random/Makefile.am | 1 + ext/arc4random/arc4random.hh | 6 ++++++ ext/arc4random/includes.h | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/ext/arc4random/Makefile.am b/ext/arc4random/Makefile.am index 3a33bbe3c9..e776e0e0ad 100644 --- a/ext/arc4random/Makefile.am +++ b/ext/arc4random/Makefile.am @@ -5,5 +5,6 @@ libarc4random_la_SOURCES = \ arc4random.hh \ arc4random_uniform.c \ bsd-getentropy.c \ + chacha_private.h \ includes.h \ log.h diff --git a/ext/arc4random/arc4random.hh b/ext/arc4random/arc4random.hh index 1af8fee380..f9f779f12e 100644 --- a/ext/arc4random/arc4random.hh +++ b/ext/arc4random/arc4random.hh @@ -5,7 +5,13 @@ extern "C" { +#ifndef HAVE_ARC4RANDOM uint32_t arc4random(void); +#endif +#ifndef HAVE_ARC4RANDOM_BUF void arc4random_buf(void* buf, size_t nbytes); +#endif +#ifndef HAVE_ARC4RANDOM_UNIFORM uint32_t arc4random_uniform(uint32_t upper_bound); +#endif } diff --git a/ext/arc4random/includes.h b/ext/arc4random/includes.h index 81f04a3bef..0a3882e483 100644 --- a/ext/arc4random/includes.h +++ b/ext/arc4random/includes.h @@ -11,8 +11,14 @@ #define seed_from_prngd(a, b) -1 +#ifndef HAVE_ARC4RANDOM uint32_t arc4random(void); +#endif +#ifndef HAVE_ARC4RANDOM_BUF void arc4random_buf(void *buf, size_t nbytes); +#endif +#ifndef HAVE_ARC4RANDOM_UNIFORM uint32_t arc4random_uniform(uint32_t upper_bound); +#endif #define DEF_WEAK(x) -- 2.47.3