]> granicus.if.org Git - python/commitdiff
Issue #28676: Prevent missing 'getentropy' declaration warning on macOS.
authorNed Deily <nad@python.org>
Sat, 12 Nov 2016 21:35:48 +0000 (16:35 -0500)
committerNed Deily <nad@python.org>
Sat, 12 Nov 2016 21:35:48 +0000 (16:35 -0500)
Patch by Gareth Rees.

Misc/NEWS
Python/random.c

index 42cab9bac889d5bbef86c6356ce276972c5d4deb..989fa4446af916a1557e41d314bd79b76031555e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -597,6 +597,9 @@ Build
 - Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X.
   Also update FreedBSD version checks for the original ctype UTF-8 workaround.
 
+- Issue #28676: Prevent missing 'getentropy' declaration warning on macOS.
+  Patch by Gareth Rees.
+
 
 What's New in Python 3.5.2?
 ===========================
index f2ada5f0d8438dbd88f51be49ea4f0634cc97761..154f6f9684c1ca5af7c861cfebbadbd88e8c66ea 100644 (file)
@@ -9,9 +9,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