summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS3
-rw-r--r--Python/random.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 161de76..352bbf7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -437,6 +437,9 @@ Build
- Issue #15819: Remove redundant include search directory option for building
outside the source tree.
+- Issue #28676: Prevent missing 'getentropy' declaration warning on macOS.
+ Patch by Gareth Rees.
+
Tools/Demos
-----------
diff --git a/Python/random.c b/Python/random.c
index 6f9f711..46e3bb5 100644
--- a/Python/random.c
+++ b/Python/random.c
@@ -12,9 +12,10 @@
# ifdef HAVE_LINUX_RANDOM_H
# include <linux/random.h>
# endif
-# ifdef HAVE_GETRANDOM
+# if defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY)
# include <sys/random.h>
-# elif defined(HAVE_GETRANDOM_SYSCALL)
+# endif
+# if !defined(HAVE_GETRANDOM) && defined(HAVE_GETRANDOM_SYSCALL)
# include <sys/syscall.h>
# endif
#endif