summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-16 09:03:51 (GMT)
committerGitHub <noreply@github.com>2017-04-16 09:03:51 (GMT)
commit49a905958ffc2fcd5d1d1a293ae453d45deeb884 (patch)
tree0b3c2dbf3f41c975fe1bb0aaea1e9a75c1de9d8c
parent4f43f87b6246e13e0eefc793a2c5415c915723c3 (diff)
downloadcpython-49a905958ffc2fcd5d1d1a293ae453d45deeb884.zip
cpython-49a905958ffc2fcd5d1d1a293ae453d45deeb884.tar.gz
cpython-49a905958ffc2fcd5d1d1a293ae453d45deeb884.tar.bz2
[3.5] bpo-29943: Do not replace the function PySlice_GetIndicesEx() with a macro (#1049)
if Py_LIMITED_API is not defined.
-rw-r--r--Include/sliceobject.h2
-rw-r--r--Misc/NEWS4
2 files changed, 4 insertions, 2 deletions
diff --git a/Include/sliceobject.h b/Include/sliceobject.h
index 3626354..579ac07 100644
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -45,11 +45,13 @@ PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
Py_ssize_t *step, Py_ssize_t *slicelength);
#if !defined(Py_LIMITED_API) || (Py_LIMITED_API+0 >= 0x03050400 && Py_LIMITED_API+0 < 0x03060000) || Py_LIMITED_API+0 >= 0x03060100
+#ifdef Py_LIMITED_API
#define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \
PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? \
((*(slicelen) = 0), -1) : \
((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
0))
+#endif
PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,
diff --git a/Misc/NEWS b/Misc/NEWS
index d440363..146a39c 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -160,8 +160,8 @@ C API
-----
- Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro if
- Py_LIMITED_API is not set or set to the value between 0x03050400
- and 0x03060000 (not including) or 0x03060100 or higher.
+ Py_LIMITED_API is set to the value between 0x03050400 and 0x03060000 (not
+ including) or 0x03060100 or higher.
- Issue #29083: Fixed the declaration of some public API functions.
PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in