mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Respect USE_COMMON_RANDOM
macro by a command line option [ci skip]
This commit is contained in:
parent
b584c106d9
commit
f6bf5e2c5f
1 changed files with 8 additions and 4 deletions
12
random.c
12
random.c
|
@ -487,14 +487,18 @@ fill_random_bytes_urandom(void *seed, size_t size)
|
||||||
#if 0
|
#if 0
|
||||||
#elif defined MAC_OS_X_VERSION_10_7 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
|
#elif defined MAC_OS_X_VERSION_10_7 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
|
||||||
|
|
||||||
# if defined MAC_OS_X_VERSION_10_10 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
|
# if defined(USE_COMMON_RANDOM)
|
||||||
# include <CommonCrypto/CommonCryptoError.h> /* for old Xcode */
|
# elif defined MAC_OS_X_VERSION_10_10 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
|
||||||
# include <CommonCrypto/CommonRandom.h>
|
|
||||||
# define USE_COMMON_RANDOM 1
|
# define USE_COMMON_RANDOM 1
|
||||||
# else
|
# else
|
||||||
# include <Security/SecRandom.h>
|
|
||||||
# define USE_COMMON_RANDOM 0
|
# define USE_COMMON_RANDOM 0
|
||||||
# endif
|
# endif
|
||||||
|
# if USE_COMMON_RANDOM
|
||||||
|
# include <CommonCrypto/CommonCryptoError.h> /* for old Xcode */
|
||||||
|
# include <CommonCrypto/CommonRandom.h>
|
||||||
|
# else
|
||||||
|
# include <Security/SecRandom.h>
|
||||||
|
# endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
fill_random_bytes_syscall(void *seed, size_t size, int unused)
|
fill_random_bytes_syscall(void *seed, size_t size, int unused)
|
||||||
|
|
Loading…
Reference in a new issue