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
|
||||
#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
|
||||
# include <CommonCrypto/CommonCryptoError.h> /* for old Xcode */
|
||||
# include <CommonCrypto/CommonRandom.h>
|
||||
# if defined(USE_COMMON_RANDOM)
|
||||
# elif defined MAC_OS_X_VERSION_10_10 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
|
||||
# define USE_COMMON_RANDOM 1
|
||||
# else
|
||||
# include <Security/SecRandom.h>
|
||||
# define USE_COMMON_RANDOM 0
|
||||
# endif
|
||||
# if USE_COMMON_RANDOM
|
||||
# include <CommonCrypto/CommonCryptoError.h> /* for old Xcode */
|
||||
# include <CommonCrypto/CommonRandom.h>
|
||||
# else
|
||||
# include <Security/SecRandom.h>
|
||||
# endif
|
||||
|
||||
static int
|
||||
fill_random_bytes_syscall(void *seed, size_t size, int unused)
|
||||
|
|
Loading…
Reference in a new issue