Comparison

util-src/crand.c @ 8422:6eecf82ccd8e

util.crand: Always include stdlib to be sure __GLIBC_PREREQ is defined
author Kim Alvefur <zash@zash.se>
date Fri, 01 Dec 2017 00:27:37 +0100
parent 8127:3e443d6791e6
child 8423:65c82a7d0537
comparison
equal deleted inserted replaced
8418:ad1e10c93b41 8422:6eecf82ccd8e
18 * Caution! This has not been extensively tested. 18 * Caution! This has not been extensively tested.
19 * 19 *
20 */ 20 */
21 21
22 #define _DEFAULT_SOURCE 22 #define _DEFAULT_SOURCE
23
24 #include <stdlib.h>
23 25
24 #include "lualib.h" 26 #include "lualib.h"
25 #include "lauxlib.h" 27 #include "lauxlib.h"
26 28
27 #include <string.h> 29 #include <string.h>
47 } 49 }
48 #else 50 #else
49 #include <sys/random.h> 51 #include <sys/random.h>
50 #endif 52 #endif
51 53
52 #elif defined(WITH_ARC4RANDOM)
53 #include <stdlib.h>
54 #elif defined(WITH_OPENSSL) 54 #elif defined(WITH_OPENSSL)
55 #include <openssl/rand.h> 55 #include <openssl/rand.h>
56 #else 56 #elif ! defined(WITH_ARC4RANDOM)
57 #error util.crand compiled without a random source 57 #error util.crand compiled without a random source
58 #endif 58 #endif
59 59
60 int Lrandom(lua_State *L) { 60 int Lrandom(lua_State *L) {
61 int ret = 0; 61 int ret = 0;