mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
Issue #15422: get rid of PyCFunction_New macro
This commit is contained in:
parent
914ab8420e
commit
3ba3a3ee56
9 changed files with 20 additions and 23 deletions
|
@ -13,6 +13,12 @@ static int numfree = 0;
|
|||
#define PyCFunction_MAXFREELIST 256
|
||||
#endif
|
||||
|
||||
PyObject *
|
||||
PyCFunction_New(PyMethodDef *ml, PyObject *self)
|
||||
{
|
||||
return PyCFunction_NewEx(ml, self, NULL);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
|
||||
{
|
||||
|
@ -346,17 +352,3 @@ _PyCFunction_DebugMallocStats(FILE *out)
|
|||
"free PyCFunction",
|
||||
numfree, sizeof(PyCFunction));
|
||||
}
|
||||
|
||||
/* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(),
|
||||
but it's part of the API so we need to keep a function around that
|
||||
existing C extensions can call.
|
||||
*/
|
||||
|
||||
#undef PyCFunction_New
|
||||
PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *);
|
||||
|
||||
PyObject *
|
||||
PyCFunction_New(PyMethodDef *ml, PyObject *self)
|
||||
{
|
||||
return PyCFunction_NewEx(ml, self, NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue