Forked from karthicraghupathi/Python-3.4.x-macos.patch
Created
March 5, 2022 01:18
-
-
Save madmax/6e076baffe6ed37cb7dafa22f6907451 to your computer and use it in GitHub Desktop.
Patch for Python 3.4.x for macos, based on comments from https://gist.github.com/orip/00142a498cf6d0c536b5d38771ad6249 and https://github.com/pyenv/pyenv/issues/1643 (specifically https://github.com/python/cpython/commit/8ea6353.patch)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Python/random.c b/Python/random.c | |
index 93d300d..396041d 100644 | |
--- 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 | |
#ifdef HAVE_SYS_STAT_H | |
#include <sys/stat.h> | |
#endif | |
diff --git a/Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst b/Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst | |
new file mode 100644 | |
index 0000000000000..ded66b567a92d | |
--- /dev/null | |
+++ b/Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst | |
@@ -0,0 +1 @@ | |
+Support macOS 11 when building. | |
diff --git a/configure b/configure | |
index c51f396824b63..5024860ca4395 100755 | |
--- a/configure | |
+++ b/configure | |
@@ -3426,7 +3426,7 @@ $as_echo "#define _BSD_SOURCE 1" >>confdefs.h | |
# has no effect, don't bother defining them | |
Darwin/[6789].*) | |
define_xopen_source=no;; | |
- Darwin/1[0-9].*) | |
+ Darwin/[12][0-9].*) | |
define_xopen_source=no;; | |
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but | |
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined | |
diff --git a/configure.ac b/configure.ac | |
index 70deefb6b9aea..5a3e340aa3e72 100644 | |
--- a/configure.ac | |
+++ b/configure.ac | |
@@ -510,7 +510,7 @@ case $ac_sys_system/$ac_sys_release in | |
# has no effect, don't bother defining them | |
Darwin/@<:@6789@:>@.*) | |
define_xopen_source=no;; | |
- Darwin/1@<:@0-9@:>@.*) | |
+ Darwin/@<:@[12]@:>@@<:@0-9@:>@.*) | |
define_xopen_source=no;; | |
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but | |
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment