mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Backport METH_FASTCALL from Python 3.7 (#328)
This commit is contained in:
parent
70c97f598b
commit
cf73bbd678
102 changed files with 2896 additions and 3301 deletions
14
third_party/python/Include/methodobject.h
vendored
14
third_party/python/Include/methodobject.h
vendored
|
@ -14,10 +14,12 @@ extern PyTypeObject PyCFunction_Type;
|
|||
#define PyCFunction_Check(op) (Py_TYPE(op) == &PyCFunction_Type)
|
||||
|
||||
typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
|
||||
typedef PyObject *(*_PyCFunctionFast) (PyObject *self, PyObject **args,
|
||||
Py_ssize_t nargs, PyObject *kwnames);
|
||||
typedef PyObject *(*_PyCFunctionFast) (PyObject *, PyObject **, Py_ssize_t);
|
||||
typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
|
||||
PyObject *);
|
||||
typedef PyObject *(*_PyCFunctionFastWithKeywords) (PyObject *,
|
||||
PyObject **, Py_ssize_t,
|
||||
PyObject *);
|
||||
typedef PyObject *(*PyNoArgsFunction)(PyObject *);
|
||||
|
||||
PyCFunction PyCFunction_GetFunction(PyObject *);
|
||||
|
@ -93,12 +95,20 @@ typedef struct {
|
|||
PyObject *m_module; /* The __module__ attribute, can be anything */
|
||||
PyObject *m_weakreflist; /* List of weak references */
|
||||
} PyCFunctionObject;
|
||||
|
||||
PyObject * _PyMethodDef_RawFastCallDict(
|
||||
PyMethodDef *method,
|
||||
PyObject *self,
|
||||
PyObject **args,
|
||||
Py_ssize_t nargs,
|
||||
PyObject *kwargs);
|
||||
|
||||
PyObject * _PyMethodDef_RawFastCallKeywords(
|
||||
PyMethodDef *method,
|
||||
PyObject *self,
|
||||
PyObject **args,
|
||||
Py_ssize_t nargs,
|
||||
PyObject *kwnames);
|
||||
#endif
|
||||
|
||||
int PyCFunction_ClearFreeList(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue