summaryrefslogtreecommitdiffstats
path: root/Include/object.h
diff options
context:
space:
mode:
authorPetr Viktorin <encukou@gmail.com>2022-08-08 12:12:05 (GMT)
committerGitHub <noreply@github.com>2022-08-08 12:12:05 (GMT)
commit656dad702d3b25bf678ee9bd7109d98876946258 (patch)
treed532248aca4a64f0ad9fb431f34398c1afc05ff5 /Include/object.h
parentcc9160a29bc3356ced92348bcd8e6668c67167c9 (diff)
downloadcpython-656dad702d3b25bf678ee9bd7109d98876946258.zip
cpython-656dad702d3b25bf678ee9bd7109d98876946258.tar.gz
cpython-656dad702d3b25bf678ee9bd7109d98876946258.tar.bz2
gh-93274: Expose receiving vectorcall in the Limited API (GH-95717)
Diffstat (limited to 'Include/object.h')
-rw-r--r--Include/object.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Include/object.h b/Include/object.h
index c00b9eb..7d499d8 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -228,6 +228,11 @@ typedef int (*initproc)(PyObject *, PyObject *, PyObject *);
typedef PyObject *(*newfunc)(PyTypeObject *, PyObject *, PyObject *);
typedef PyObject *(*allocfunc)(PyTypeObject *, Py_ssize_t);
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000 // 3.12
+typedef PyObject *(*vectorcallfunc)(PyObject *callable, PyObject *const *args,
+ size_t nargsf, PyObject *kwnames);
+#endif
+
typedef struct{
int slot; /* slot id, see below */
void *pfunc; /* function pointer */
@@ -381,11 +386,13 @@ given type object has a specified feature.
#define Py_TPFLAGS_BASETYPE (1UL << 10)
/* Set if the type implements the vectorcall protocol (PEP 590) */
-#ifndef Py_LIMITED_API
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
#define Py_TPFLAGS_HAVE_VECTORCALL (1UL << 11)
+#ifndef Py_LIMITED_API
// Backwards compatibility alias for API that was provisional in Python 3.8
#define _Py_TPFLAGS_HAVE_VECTORCALL Py_TPFLAGS_HAVE_VECTORCALL
#endif
+#endif
/* Set if the type is 'ready' -- fully initialized */
#define Py_TPFLAGS_READY (1UL << 12)