]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
all SCHED_ constants are optional (closes #27656)
authorBenjamin Peterson <benjamin@python.org>
Sun, 31 Jul 2016 06:21:50 +0000 (23:21 -0700)
committerBenjamin Peterson <benjamin@python.org>
Sun, 31 Jul 2016 06:21:50 +0000 (23:21 -0700)
Misc/NEWS
Modules/posixmodule.c

index 6b2b41921fec0c0d245b335c625661654f4b7152..0a6ddf49c05d67e70aa3cea221e064b0c8ff65ed 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -34,6 +34,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #27656: Do not assume sched.h defines any SCHED_* constants.
+
 - Issue #27130: In the "zlib" module, fix handling of large buffers
   (typically 4 GiB) when compressing and decompressing.  Previously, inputs
   were limited to 4 GiB, and compression and decompression operations did not
index ee600fc237e8c85801a5c267fb2c9a6ddb356cc6..b854cafb6f746b68d8d01f254f2f07817dd93f48 100644 (file)
@@ -12750,9 +12750,15 @@ all_ins(PyObject *m)
 #endif
 
 #ifdef HAVE_SCHED_H
+#ifdef SCHED_OTHER
     if (PyModule_AddIntMacro(m, SCHED_OTHER)) return -1;
+#endif
+#ifdef SCHED_FIFO
     if (PyModule_AddIntMacro(m, SCHED_FIFO)) return -1;
+#endif
+#ifdef SCHED_RR
     if (PyModule_AddIntMacro(m, SCHED_RR)) return -1;
+#endif
 #ifdef SCHED_SPORADIC
     if (PyModule_AddIntMacro(m, SCHED_SPORADIC) return -1;
 #endif