summaryrefslogtreecommitdiffstats
path: root/Include/cpython/methodobject.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-06-13 18:09:40 (GMT)
committerGitHub <noreply@github.com>2022-06-13 18:09:40 (GMT)
commitdf22eec4215e515e36e387b9022fb8ca95fd39af (patch)
tree4ffe387870208583adfa22ab275ba72dcdbea1c5 /Include/cpython/methodobject.h
parentc2007573dd449ae054f9fd5227e49ac9eef00ae8 (diff)
downloadcpython-df22eec4215e515e36e387b9022fb8ca95fd39af.zip
cpython-df22eec4215e515e36e387b9022fb8ca95fd39af.tar.gz
cpython-df22eec4215e515e36e387b9022fb8ca95fd39af.tar.bz2
gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766)
Header files in the Include/cpython/ are only included if the Py_LIMITED_API macro is not defined.
Diffstat (limited to 'Include/cpython/methodobject.h')
-rw-r--r--Include/cpython/methodobject.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/Include/cpython/methodobject.h b/Include/cpython/methodobject.h
index 54a61cf..eac9e08 100644
--- a/Include/cpython/methodobject.h
+++ b/Include/cpython/methodobject.h
@@ -40,9 +40,7 @@ PyAPI_DATA(PyTypeObject) PyCMethod_Type;
static inline PyCFunction PyCFunction_GET_FUNCTION(PyObject *func) {
return _PyCFunctionObject_CAST(func)->m_ml->ml_meth;
}
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
-# define PyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(_PyObject_CAST(func))
-#endif
+#define PyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(_PyObject_CAST(func))
static inline PyObject* PyCFunction_GET_SELF(PyObject *func_obj) {
PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj);
@@ -51,16 +49,12 @@ static inline PyObject* PyCFunction_GET_SELF(PyObject *func_obj) {
}
return func->m_self;
}
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
-# define PyCFunction_GET_SELF(func) PyCFunction_GET_SELF(_PyObject_CAST(func))
-#endif
+#define PyCFunction_GET_SELF(func) PyCFunction_GET_SELF(_PyObject_CAST(func))
static inline int PyCFunction_GET_FLAGS(PyObject *func) {
return _PyCFunctionObject_CAST(func)->m_ml->ml_flags;
}
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
-# define PyCFunction_GET_FLAGS(func) PyCFunction_GET_FLAGS(_PyObject_CAST(func))
-#endif
+#define PyCFunction_GET_FLAGS(func) PyCFunction_GET_FLAGS(_PyObject_CAST(func))
static inline PyTypeObject* PyCFunction_GET_CLASS(PyObject *func_obj) {
PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj);
@@ -69,6 +63,4 @@ static inline PyTypeObject* PyCFunction_GET_CLASS(PyObject *func_obj) {
}
return _Py_NULL;
}
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
-# define PyCFunction_GET_CLASS(func) PyCFunction_GET_CLASS(_PyObject_CAST(func))
-#endif
+#define PyCFunction_GET_CLASS(func) PyCFunction_GET_CLASS(_PyObject_CAST(func))