[Python-checkins] cpython (2.7): Issue #28676: Prevent missing 'getentropy' declaration warning on macOS.

ned.deily python-checkins at python.org
Sat Nov 12 16:40:38 EST 2016


https://hg.python.org/cpython/rev/828251c2bccf
changeset:   105077:828251c2bccf
branch:      2.7
parent:      105074:b968faeb8d1b
user:        Ned Deily <nad at python.org>
date:        Sat Nov 12 16:34:25 2016 -0500
summary:
  Issue #28676: Prevent missing 'getentropy' declaration warning on macOS.
Initial patch by Gareth Rees.

files:
  Misc/NEWS       |  3 +++
  Python/random.c |  3 +++
  2 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -295,6 +295,9 @@
 - Issue #27806: Fix 32-bit builds on macOS Sierra 10.12 broken by removal of
   deprecated QuickTime/QuickTime.h header file.  Patch by Aleks Bunin.
 
+- Issue #28676: Prevent missing 'getentropy' declaration warning on macOS.
+  Initial patch by Gareth Rees.
+
 Tools/Demos
 -----------
 
diff --git a/Python/random.c b/Python/random.c
--- a/Python/random.c
+++ b/Python/random.c
@@ -3,6 +3,9 @@
 #include <windows.h>
 #else
 #include <fcntl.h>
+#if defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY)
+#include <sys/random.h>
+#endif
 #endif
 
 #ifdef Py_DEBUG

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list