py_compat: Add vectorcall functions
This commit is contained in:
parent
80806510c2
commit
b630e14dc4
|
|
@ -219,6 +219,14 @@ INLINE PyObject *_PyLong_Lshift(PyObject *a, size_t shiftby) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef PY_VECTORCALL_ARGUMENTS_OFFSET
|
||||
# define PY_VECTORCALL_ARGUMENTS_OFFSET (((size_t)1) << (8 * sizeof(size_t) - 1))
|
||||
#endif
|
||||
|
||||
#if PY_VERSION_HEX < 0x030800B1
|
||||
# define PyVectorcall_NARGS(n) ((n) & ~PY_VECTORCALL_ARGUMENTS_OFFSET)
|
||||
#endif
|
||||
|
||||
/* Python 3.9 */
|
||||
|
||||
#if PY_VERSION_HEX < 0x030900A4 && !defined(Py_IS_TYPE)
|
||||
|
|
@ -229,6 +237,10 @@ INLINE PyObject *_PyLong_Lshift(PyObject *a, size_t shiftby) {
|
|||
# define PyCFunction_CheckExact(op) (Py_IS_TYPE(op, &PyCFunction_Type))
|
||||
#endif
|
||||
|
||||
#if PY_VERSION_HEX < 0x030900A4
|
||||
# define PyObject_Vectorcall(callable, args, nargsf, kwnames) (_PyObject_Vectorcall((callable), (args), (nargsf), (kwnames)))
|
||||
#endif
|
||||
|
||||
#if PY_VERSION_HEX < 0x03090000
|
||||
INLINE PyObject *PyObject_CallNoArgs(PyObject *func) {
|
||||
#if PY_VERSION_HEX >= 0x03080000
|
||||
|
|
|
|||
Loading…
Reference in New Issue