We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 287bac9 commit 9c93290Copy full SHA for 9c93290
1 file changed
so/maps/maps.h
@@ -1,17 +1,18 @@
1
#include <time.h>
2
+#include "so/builtin/builtin.h"
3
-#if defined(__APPLE__)
4
+#if defined(so_build_darwin)
5
#include <stdlib.h>
-#elif defined(__linux__)
6
+#elif defined(so_build_linux)
7
#include <sys/random.h>
8
#endif
9
10
// seed returns a random 64-bit seed for hash randomization.
11
static inline uint64_t maps_seed(void) {
12
uint64_t seed = 0;
13
14
arc4random_buf(&seed, sizeof(seed));
15
16
if (getrandom(&seed, sizeof(seed), 0) != sizeof(seed)) {
17
// Fallback to time-based seed.
18
struct timespec ts;
0 commit comments