summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2021-08-25 08:54:38 +0100
committerTomas Mraz <tomas@openssl.org>2021-08-27 08:51:05 +0200
commitc023d98dcf2ba1cc30f545ae54d0e037e80a8794 (patch)
tree496eb7a7105c90f41e317f677aaf26866cc9307d /include
parent6f242d224cd1f5d9f4d9b3a1722cca93b92d25b0 (diff)
Darwin platform allows to build on releases before Yosemite/ios 8.
backport #16409 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16418)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/rand.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/crypto/rand.h b/include/crypto/rand.h
index d9432b241d..ac41a9f62b 100644
--- a/include/crypto/rand.h
+++ b/include/crypto/rand.h
@@ -22,6 +22,16 @@
# include <openssl/rand.h>
# include "crypto/rand_pool.h"
+# if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
+# include <Availability.h>
+# if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000) || \
+ (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000)
+# define OPENSSL_APPLE_CRYPTO_RANDOM 1
+# include <CommonCrypto/CommonCryptoError.h>
+# include <CommonCrypto/CommonRandom.h>
+# endif
+# endif
+
/*
* Defines related to seed sources
*/