From 7a18af8c8e5cbb8cfd8739a0eb8fca9157808ab8 Mon Sep 17 00:00:00 2001 From: Srivatsan Iyer Date: Tue, 15 Nov 2022 12:38:41 +0530 Subject: [PATCH] Exclude arc4random_buf implementation if it's already present in the platform (#1375) This patch excludes definition of arc4random_buf on systems where it is already present. When the symbol is found, the macro EVENT__HAVE_ARC4RANDOM_BUF is set via CMake's configure_file(..). Co-authored-by: Azat Khuzhin --- arc4random.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arc4random.c b/arc4random.c index c9533b17..b3ec7655 100644 --- a/arc4random.c +++ b/arc4random.c @@ -471,6 +471,7 @@ arc4random(void) } #endif +#ifndef EVENT__HAVE_ARC4RANDOM_BUF ARC4RANDOM_EXPORT void arc4random_buf(void *buf_, size_t n) { @@ -484,6 +485,7 @@ arc4random_buf(void *buf_, size_t n) } ARC4_UNLOCK_(); } +#endif /* #ifndef EVENT__HAVE_ARC4RANDOM_BUF */ #ifndef ARC4RANDOM_NOUNIFORM /*