mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
Lagom: Adjust AK, LibCore and LibTLS to build on MacOS
This commit is contained in:
parent
4e8de753c9
commit
9a4ee9aa1a
3 changed files with 19 additions and 3 deletions
|
@ -37,13 +37,17 @@
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
# include <sys/random.h>
|
||||
#endif
|
||||
|
||||
namespace AK {
|
||||
|
||||
inline void fill_with_random(void* buffer, size_t length)
|
||||
{
|
||||
#if defined(__serenity__)
|
||||
arc4random_buf(buffer, length);
|
||||
#elif defined(__linux__)
|
||||
#elif defined(__linux__) or defined(__APPLE__)
|
||||
int rc = getentropy(buffer, length);
|
||||
(void)rc;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue