mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
py_panda: backport some py_compat.h definitions
This commit is contained in:
parent
9cb129597c
commit
a7042091be
@ -208,6 +208,28 @@ INLINE PyObject *_PyLong_Lshift(PyObject *a, size_t shiftby) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PY_VERSION_HEX < 0x03090000
|
||||||
|
INLINE EXPCL_PYPANDA PyObject *PyObject_CallNoArgs(PyObject *func) {
|
||||||
|
return _PyObject_CallNoArg(func);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE PyObject *PyObject_CallOneArg(PyObject *callable, PyObject *arg) {
|
||||||
|
#if PY_VERSION_HEX >= 0x03060000
|
||||||
|
return _PyObject_FastCall(callable, &arg, 1);
|
||||||
|
#else
|
||||||
|
return PyObject_CallFunctionObjArgs(callable, arg, nullptr);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE PyObject *PyObject_CallMethodNoArgs(PyObject *obj, PyObject *name) {
|
||||||
|
return PyObject_CallMethodObjArgs(obj, name, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE PyObject *PyObject_CallMethodOneArg(PyObject *obj, PyObject *name, PyObject *arg) {
|
||||||
|
return PyObject_CallMethodObjArgs(obj, name, arg, nullptr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Other Python implementations */
|
/* Other Python implementations */
|
||||||
|
|
||||||
// _PyErr_OCCURRED is an undocumented macro version of PyErr_Occurred.
|
// _PyErr_OCCURRED is an undocumented macro version of PyErr_Occurred.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user