Browse Source

bpo-43239: Export PyCFunction_New with PyAPI_FUNC (GH-24551)

pull/24629/head
Petr Viktorin 5 years ago
committed by GitHub
parent
commit
7bb1cafa4e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      Include/methodobject.h
  2. 2
      Misc/NEWS.d/next/C API/2021-02-16-17-30-16.bpo-43239.FQqOGz.rst

6
Include/methodobject.h

@ -41,7 +41,13 @@ struct PyMethodDef {
};
typedef struct PyMethodDef PyMethodDef;
/* PyCFunction_New is declared as a function for stable ABI (declaration is
* needed for e.g. GCC with -fvisibility=hidden), but redefined as a macro
* that calls PyCFunction_NewEx. */
PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *);
#define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL)
/* PyCFunction_NewEx is similar: on 3.9+, this calls PyCMethod_New. */
PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *,
PyObject *);

2
Misc/NEWS.d/next/C API/2021-02-16-17-30-16.bpo-43239.FQqOGz.rst

@ -0,0 +1,2 @@
The :c:func:`PyCFunction_New` function is now exported in the ABI when
compiled with ``-fvisibility=hidden``.
Loading…
Cancel
Save