1
Fork 0
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:
Marcin Gasperowicz 2020-05-29 22:22:01 +02:00 committed by Andreas Kling
parent 4e8de753c9
commit 9a4ee9aa1a
3 changed files with 19 additions and 3 deletions

View file

@ -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