mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 19:19:53 +00:00
Use /dev/urandom for janet_cryptorand on cygwin
This commit is contained in:
parent
0a8eb9e3ba
commit
3254c2c477
@ -869,7 +869,7 @@ int janet_cryptorand(uint8_t *out, size_t n) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#elif defined(JANET_LINUX) || ( defined(JANET_APPLE) && !defined(MAC_OS_X_VERSION_10_7) )
|
#elif defined(JANET_LINUX) || defined(JANET_CYGWIN) || ( defined(JANET_APPLE) && !defined(MAC_OS_X_VERSION_10_7) )
|
||||||
/* We should be able to call getrandom on linux, but it doesn't seem
|
/* We should be able to call getrandom on linux, but it doesn't seem
|
||||||
to be uniformly supported on linux distros.
|
to be uniformly supported on linux distros.
|
||||||
On Mac, arc4random_buf wasn't available on until 10.7.
|
On Mac, arc4random_buf wasn't available on until 10.7.
|
||||||
|
@ -67,6 +67,11 @@ extern "C" {
|
|||||||
#define JANET_LINUX 1
|
#define JANET_LINUX 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Check for Cygwin */
|
||||||
|
#if defined(__CYGWIN__)
|
||||||
|
#define JANET_CYGWIN 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Check Unix */
|
/* Check Unix */
|
||||||
#if defined(_AIX) \
|
#if defined(_AIX) \
|
||||||
|| defined(__APPLE__) /* Darwin */ \
|
|| defined(__APPLE__) /* Darwin */ \
|
||||||
|
Loading…
Reference in New Issue
Block a user