Commit af5b1ce6 authored by Matti Picus's avatar Matti Picus Committed by Stefan Behnel

Guard uses of tp_pypy_flags and tp_vectorcall on PyPy (GH-4509)

For PyPy3.8 (the current release is 7.3.7)

* PyPy<7.3.8 declares a struct with the last fields tp_finalize, tp_print, tp_pypy_flags
* PyPy>=7.3.8 will declare a struct with the last fields tp_finalize, tp_vectorcall, tp_print

PyPy3.9 (not yet released) will declare a struct with the last fields tp_finalize, tp_vectorcall, tp_pypy_flags

See https://foss.heptapod.net/pypy/pypy/-/issues/3618
parent 3028e8c7
......@@ -888,10 +888,10 @@ slot_table = (
EmptySlot("tp_del"),
EmptySlot("tp_version_tag"),
EmptySlot("tp_finalize", ifdef="PY_VERSION_HEX >= 0x030400a1"),
EmptySlot("tp_vectorcall", ifdef="PY_VERSION_HEX >= 0x030800b1"),
EmptySlot("tp_vectorcall", ifdef="PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)"),
EmptySlot("tp_print", ifdef="PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000"),
# PyPy specific extension - only here to avoid C compiler warnings.
EmptySlot("tp_pypy_flags", ifdef="CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000"),
EmptySlot("tp_pypy_flags", ifdef="CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000"),
)
#------------------------------------------------------------------------------------------
......
......@@ -421,13 +421,13 @@ static PyTypeObject __pyx_AsyncGenType_type = {
#elif PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......@@ -659,13 +659,13 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = {
#if PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......@@ -777,13 +777,13 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = {
#if PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......@@ -1065,13 +1065,13 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = {
#if PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......
......@@ -1557,13 +1557,13 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = {
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......@@ -1717,13 +1717,13 @@ static PyTypeObject __pyx_CoroutineType_type = {
#elif PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......@@ -1831,13 +1831,13 @@ static PyTypeObject __pyx_IterableCoroutineType_type = {
#if PY_VERSION_HEX >= 0x030400a1
__Pyx_Coroutine_del, /*tp_finalize*/
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......@@ -1942,13 +1942,13 @@ static PyTypeObject __pyx_GeneratorType_type = {
#elif PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......
......@@ -730,13 +730,13 @@ static PyTypeObject __pyx_CyFunctionType_type = {
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......@@ -1262,13 +1262,13 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
#if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/
#endif
#if PY_VERSION_HEX >= 0x030800b1
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/
#endif
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment