Skip to content

Commit

Permalink
Exclude arc4random_buf implementation if it's already present in the …
Browse files Browse the repository at this point in the history
…platform (libevent#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 <[email protected]>
  • Loading branch information
supersaiyanmode and azat authored Nov 15, 2022
1 parent cdeb324 commit 7a18af8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ arc4random(void)
}
#endif

#ifndef EVENT__HAVE_ARC4RANDOM_BUF
ARC4RANDOM_EXPORT void
arc4random_buf(void *buf_, size_t n)
{
Expand All @@ -484,6 +485,7 @@ arc4random_buf(void *buf_, size_t n)
}
ARC4_UNLOCK_();
}
#endif /* #ifndef EVENT__HAVE_ARC4RANDOM_BUF */

#ifndef ARC4RANDOM_NOUNIFORM
/*
Expand Down

0 comments on commit 7a18af8

Please sign in to comment.