1
0
Fork 0
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:
Nobuyoshi Nakada 2022-10-17 15:34:00 +09:00
parent b584c106d9
commit f6bf5e2c5f
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -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)