From f6bf5e2c5f07a0e99a6f3dbc29035f911a4e477f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 17 Oct 2022 15:34:00 +0900 Subject: [PATCH] Respect `USE_COMMON_RANDOM` macro by a command line option [ci skip] --- random.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/random.c b/random.c index 013e9f66e3..f8879cfb88 100644 --- a/random.c +++ b/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 /* for old Xcode */ -# include +# 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 # define USE_COMMON_RANDOM 0 # endif +# if USE_COMMON_RANDOM +# include /* for old Xcode */ +# include +# else +# include +# endif static int fill_random_bytes_syscall(void *seed, size_t size, int unused)