Software /
code /
prosody
Comparison
util-src/crand.c @ 8448:f516a52f19e8
util.crand: Make it possible to use arc4random on Linux (needs libbsd)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 03 Dec 2017 15:21:12 +0100 |
parent | 8447:200f4f1b7833 |
child | 8449:b572a708fd41 |
comparison
equal
deleted
inserted
replaced
8447:200f4f1b7833 | 8448:f516a52f19e8 |
---|---|
52 #include <sys/random.h> | 52 #include <sys/random.h> |
53 #endif | 53 #endif |
54 | 54 |
55 #elif defined(WITH_OPENSSL) | 55 #elif defined(WITH_OPENSSL) |
56 #include <openssl/rand.h> | 56 #include <openssl/rand.h> |
57 #elif ! defined(WITH_ARC4RANDOM) | 57 #elif defined(WITH_ARC4RANDOM) |
58 #ifdef __linux__ | |
59 #include <bsd/stdlib.h> | |
60 #endif | |
61 #else | |
58 #error util.crand compiled without a random source | 62 #error util.crand compiled without a random source |
59 #endif | 63 #endif |
60 | 64 |
61 #ifndef SMALLBUFSIZ | 65 #ifndef SMALLBUFSIZ |
62 #define SMALLBUFSIZ 32 | 66 #define SMALLBUFSIZ 32 |