summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrivatsan Iyer <supersaiyanmode@users.noreply.github.com>2022-11-15 12:38:41 +0530
committerGitHub <noreply@github.com>2022-11-15 10:08:41 +0300
commit7a18af8c8e5cbb8cfd8739a0eb8fca9157808ab8 (patch)
tree5fa575f117d6bdc4715c7e6b61ad55dc43098ccc
parentcdeb3242264285335e80e5fe7dc16789505ca1fc (diff)
downloadlibevent-7a18af8c8e5cbb8cfd8739a0eb8fca9157808ab8.tar.gz
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 <a3at.mail@gmail.com>
-rw-r--r--arc4random.c2
1 files changed, 2 insertions, 0 deletions
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
/*