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 = ( ...@@ -888,10 +888,10 @@ slot_table = (
EmptySlot("tp_del"), EmptySlot("tp_del"),
EmptySlot("tp_version_tag"), EmptySlot("tp_version_tag"),
EmptySlot("tp_finalize", ifdef="PY_VERSION_HEX >= 0x030400a1"), 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"), EmptySlot("tp_print", ifdef="PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000"),
# PyPy specific extension - only here to avoid C compiler warnings. # 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 = { ...@@ -421,13 +421,13 @@ static PyTypeObject __pyx_AsyncGenType_type = {
#elif PY_VERSION_HEX >= 0x030400a1 #elif PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -659,13 +659,13 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = { ...@@ -659,13 +659,13 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -777,13 +777,13 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = { ...@@ -777,13 +777,13 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -1065,13 +1065,13 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = { ...@@ -1065,13 +1065,13 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /* tp_finalize */ 0, /* tp_finalize */
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
......
...@@ -1557,13 +1557,13 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = { ...@@ -1557,13 +1557,13 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -1717,13 +1717,13 @@ static PyTypeObject __pyx_CoroutineType_type = { ...@@ -1717,13 +1717,13 @@ static PyTypeObject __pyx_CoroutineType_type = {
#elif PY_VERSION_HEX >= 0x030400a1 #elif PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -1831,13 +1831,13 @@ static PyTypeObject __pyx_IterableCoroutineType_type = { ...@@ -1831,13 +1831,13 @@ static PyTypeObject __pyx_IterableCoroutineType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
__Pyx_Coroutine_del, /*tp_finalize*/ __Pyx_Coroutine_del, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -1942,13 +1942,13 @@ static PyTypeObject __pyx_GeneratorType_type = { ...@@ -1942,13 +1942,13 @@ static PyTypeObject __pyx_GeneratorType_type = {
#elif PY_VERSION_HEX >= 0x030400a1 #elif PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
......
...@@ -730,13 +730,13 @@ static PyTypeObject __pyx_CyFunctionType_type = { ...@@ -730,13 +730,13 @@ static PyTypeObject __pyx_CyFunctionType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #endif
}; };
...@@ -1262,13 +1262,13 @@ static PyTypeObject __pyx_FusedFunctionType_type = { ...@@ -1262,13 +1262,13 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
0, /*tp_finalize*/ 0, /*tp_finalize*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b1 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
0, /*tp_vectorcall*/ 0, /*tp_vectorcall*/
#endif #endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
0, /*tp_print*/ 0, /*tp_print*/
#endif #endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX > 0x03080000
0, /*tp_pypy_flags*/ 0, /*tp_pypy_flags*/
#endif #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