File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -370,13 +370,20 @@ static size_t read_urandom(void* buf, size_t n)
370
370
return 0 ;
371
371
}
372
372
373
+ #if defined(__APPLE__ )
374
+ #include "TargetConditionals.h"
375
+ #endif
376
+
373
377
#if defined(__APPLE__ ) && defined(__MAC_10_12 ) && !defined(__IPHONE_OS_VERSION_MIN_REQUIRED )
374
378
#include <sys/random.h>
375
379
#endif
376
380
377
381
static size_t entropy (void * buf , size_t n )
378
382
{
379
- #if defined(__APPLE__ ) && defined(__MAC_10_12 ) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_12
383
+ #if defined(__APPLE__ ) && ((defined(__MAC_10_12 ) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_12 ) || TARGET_OS_TV || TARGET_OS_WATCH )
384
+ #if TARGET_OS_TV || TARGET_OS_WATCH
385
+ extern int getentropy (void * buffer , size_t buflen );
386
+ #endif
380
387
if (getentropy (buf , n ) == 0 )
381
388
return n ;
382
389
#elif defined(__linux__ ) && defined(SYS_getrandom )
You can’t perform that action at this time.
0 commit comments