summaryrefslogtreecommitdiffstats
path: root/Include/methodobject.h
diff options
context:
space:
mode:
authorPetr Viktorin <encukou@gmail.com>2021-02-23 12:23:56 (GMT)
committerGitHub <noreply@github.com>2021-02-23 12:23:56 (GMT)
commit7bb1cafa4e3d648669212ea4c6d11d6eafc6da23 (patch)
treece09a1e53aabacef12513caea9129a068a6251ff /Include/methodobject.h
parent2d6f2eed14ff5d89155b52771cc8ef957e8145b4 (diff)
downloadcpython-7bb1cafa4e3d648669212ea4c6d11d6eafc6da23.zip
cpython-7bb1cafa4e3d648669212ea4c6d11d6eafc6da23.tar.gz
cpython-7bb1cafa4e3d648669212ea4c6d11d6eafc6da23.tar.bz2
bpo-43239: Export PyCFunction_New with PyAPI_FUNC (GH-24551)
Diffstat (limited to 'Include/methodobject.h')
-rw-r--r--Include/methodobject.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/methodobject.h b/Include/methodobject.h
index 5d06d76..7aa4e41 100644
--- a/Include/methodobject.h
+++ b/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 *);