[Python-checkins] cpython (2.7): add a specific configure check for sys/random.h (closes #28932)
benjamin.peterson
python-checkins at python.org
Tue Dec 20 02:57:34 EST 2016
https://hg.python.org/cpython/rev/32cc37a89b58
changeset: 105762:32cc37a89b58
branch: 2.7
parent: 105758:46e329ef13ae
user: Benjamin Peterson <benjamin at python.org>
date: Mon Dec 19 23:54:25 2016 -0800
summary:
add a specific configure check for sys/random.h (closes #28932)
files:
Misc/NEWS | 2 ++
Python/random.c | 2 +-
configure | 2 +-
configure.ac | 2 +-
pyconfig.h.in | 3 +++
5 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@
Core and Builtins
-----------------
+- Issue #28932: Do not include <sys/random.h> if it does not exist.
+
Library
-------
diff --git a/Python/random.c b/Python/random.c
--- a/Python/random.c
+++ b/Python/random.c
@@ -3,7 +3,7 @@
#include <windows.h>
#else
#include <fcntl.h>
-#if defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY)
+#ifdef HAVE_SYS_RANDOM_H
#include <sys/random.h>
#endif
#endif
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -7054,7 +7054,7 @@
unistd.h utime.h \
sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
sys/lock.h sys/mkdev.h sys/modem.h \
-sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
+sys/param.h sys/poll.h sys/random.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1702,7 +1702,7 @@
unistd.h utime.h \
sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
sys/lock.h sys/mkdev.h sys/modem.h \
-sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
+sys/param.h sys/poll.h sys/random.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
diff --git a/pyconfig.h.in b/pyconfig.h.in
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -781,6 +781,9 @@
/* Define to 1 if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
+/* Define to 1 if you have the <sys/random.h> header file. */
+#undef HAVE_SYS_RANDOM_H
+
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list