mirror of
https://github.com/python/cpython.git
synced 2025-09-30 04:15:43 +00:00
[3.6] bpo-29943: Do not replace the function PySlice_GetIndicesEx() with a macro (GH-1049) (#1813)
if Py_LIMITED_API is not defined.
(cherry picked from commit 49a9059
)
This commit is contained in:
parent
89a3102640
commit
f43b293f2f
2 changed files with 9 additions and 0 deletions
|
@ -45,11 +45,13 @@ PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
|
||||||
Py_ssize_t *step, Py_ssize_t *slicelength);
|
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
|
#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) ( \
|
#define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \
|
||||||
PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? \
|
PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? \
|
||||||
((*(slicelen) = 0), -1) : \
|
((*(slicelen) = 0), -1) : \
|
||||||
((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
|
((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
|
||||||
0))
|
0))
|
||||||
|
#endif
|
||||||
PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice,
|
PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice,
|
||||||
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
|
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
|
||||||
PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,
|
PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,
|
||||||
|
|
|
@ -153,6 +153,13 @@ Library
|
||||||
exception) to exception(s) raised in the dispatched methods.
|
exception) to exception(s) raised in the dispatched methods.
|
||||||
Patch by Petr Motejlek.
|
Patch by Petr Motejlek.
|
||||||
|
|
||||||
|
C API
|
||||||
|
-----
|
||||||
|
|
||||||
|
- Issue #27867: Function PySlice_GetIndicesEx() no longer replaced with a macro
|
||||||
|
if Py_LIMITED_API is not set.
|
||||||
|
|
||||||
|
|
||||||
Build
|
Build
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue