mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
interrogatedb: always define PyObject_CallNoArgs as inline
This commit is contained in:
parent
d9e335e978
commit
9dad304f85
@ -43,22 +43,4 @@ size_t PyLongOrInt_AsSize_t(PyObject *vv) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if PY_VERSION_HEX < 0x03090000
|
||||
/**
|
||||
* Most efficient way to call a function without any arguments.
|
||||
*/
|
||||
PyObject *PyObject_CallNoArgs(PyObject *func) {
|
||||
#if PY_VERSION_HEX >= 0x03080000
|
||||
return _PyObject_Vectorcall(func, nullptr, 0, nullptr);
|
||||
#elif PY_VERSION_HEX >= 0x03070000
|
||||
return _PyObject_FastCallDict(func, nullptr, 0, nullptr);
|
||||
#elif PY_VERSION_HEX >= 0x03060000
|
||||
return _PyObject_FastCall(func, nullptr, 0);
|
||||
#else
|
||||
static PyObject *empty_tuple = PyTuple_New(0);
|
||||
return PyObject_Call(func, empty_tuple, nullptr);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // HAVE_PYTHON
|
||||
|
@ -212,7 +212,17 @@ INLINE PyObject *_PyLong_Lshift(PyObject *a, size_t shiftby) {
|
||||
/* Python 3.9 */
|
||||
|
||||
#if PY_VERSION_HEX < 0x03090000
|
||||
EXPCL_PYPANDA PyObject *PyObject_CallNoArgs(PyObject *func);
|
||||
INLINE PyObject *PyObject_CallNoArgs(PyObject *func) {
|
||||
#if PY_VERSION_HEX >= 0x03080000
|
||||
return _PyObject_Vectorcall(func, nullptr, 0, nullptr);
|
||||
#elif PY_VERSION_HEX >= 0x03070000
|
||||
return _PyObject_FastCallDict(func, nullptr, 0, nullptr);
|
||||
#elif PY_VERSION_HEX >= 0x03060000
|
||||
return _PyObject_FastCall(func, nullptr, 0);
|
||||
#else
|
||||
return PyObject_CallObject(func, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
INLINE PyObject *PyObject_CallOneArg(PyObject *callable, PyObject *arg) {
|
||||
#if PY_VERSION_HEX >= 0x03060000
|
||||
|
Loading…
x
Reference in New Issue
Block a user