diff options
author | Inada Naoki <songofacandy@gmail.com> | 2023-05-31 09:38:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 09:38:55 (GMT) |
commit | adccff3b3f9fbdb58cb4b8fde92456e6dd078af0 (patch) | |
tree | 3eea6fd8543a6a8e800b4792ad7c276598f3afb5 /Include | |
parent | f90d3f68db720bd6d0deda8cc0030339ccd43858 (diff) | |
download | cpython-adccff3b3f9fbdb58cb4b8fde92456e6dd078af0.zip cpython-adccff3b3f9fbdb58cb4b8fde92456e6dd078af0.tar.gz cpython-adccff3b3f9fbdb58cb4b8fde92456e6dd078af0.tar.bz2 |
gh-104922: Make `PY_SSIZE_T_CLEAN` not mandatory again (#105051)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/abstract.h | 15 | ||||
-rw-r--r-- | Include/cpython/abstract.h | 9 | ||||
-rw-r--r-- | Include/cpython/modsupport.h | 21 | ||||
-rw-r--r-- | Include/modsupport.h | 23 |
4 files changed, 3 insertions, 65 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index 064b030..b4c2bed 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -135,12 +135,6 @@ extern "C" { This function always succeeds. */ -#ifdef PY_SSIZE_T_CLEAN -# define PyObject_CallFunction _PyObject_CallFunction_SizeT -# define PyObject_CallMethod _PyObject_CallMethod_SizeT -#endif - - #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000 /* Call a callable Python object without any arguments */ PyAPI_FUNC(PyObject *) PyObject_CallNoArgs(PyObject *func); @@ -195,15 +189,6 @@ PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *obj, const char *name, const char *format, ...); -PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable, - const char *format, - ...); - -PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *obj, - const char *name, - const char *format, - ...); - /* Call a callable Python object 'callable' with a variable number of C arguments. The C arguments are provided as PyObject* values, terminated by a NULL. diff --git a/Include/cpython/abstract.h b/Include/cpython/abstract.h index 3b27aab..992dd06 100644 --- a/Include/cpython/abstract.h +++ b/Include/cpython/abstract.h @@ -4,10 +4,6 @@ /* === Object Protocol ================================================== */ -#ifdef PY_SSIZE_T_CLEAN -# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT -#endif - /* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple) format to a Python dictionary ("kwargs" dict). @@ -113,11 +109,6 @@ PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj, _Py_Identifier *name, const char *format, ...); -PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj, - _Py_Identifier *name, - const char *format, - ...); - PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs( PyObject *obj, _Py_Identifier *name, diff --git a/Include/cpython/modsupport.h b/Include/cpython/modsupport.h index 88f34fe..a5d95d1 100644 --- a/Include/cpython/modsupport.h +++ b/Include/cpython/modsupport.h @@ -2,20 +2,6 @@ # error "this header file must not be included directly" #endif -/* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier - to mean Py_ssize_t */ -#ifdef PY_SSIZE_T_CLEAN -#define _Py_VaBuildStack _Py_VaBuildStack_SizeT -#else -PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list); -PyAPI_FUNC(PyObject **) _Py_VaBuildStack_SizeT( - PyObject **small_stack, - Py_ssize_t small_stack_len, - const char *format, - va_list va, - Py_ssize_t *p_nargs); -#endif - PyAPI_FUNC(int) _PyArg_UnpackStack( PyObject *const *args, Py_ssize_t nargs, @@ -63,13 +49,6 @@ typedef struct _PyArg_Parser { struct _PyArg_Parser *next; } _PyArg_Parser; -#ifdef PY_SSIZE_T_CLEAN -#define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT -#define _PyArg_ParseStack _PyArg_ParseStack_SizeT -#define _PyArg_ParseStackAndKeywords _PyArg_ParseStackAndKeywords_SizeT -#define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT -#endif - PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *, struct _PyArg_Parser *, ...); PyAPI_FUNC(int) _PyArg_ParseStack( diff --git a/Include/modsupport.h b/Include/modsupport.h index 4e369bd..7d4cfe8 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -9,34 +9,17 @@ extern "C" { #include <stdarg.h> // va_list -/* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier - to mean Py_ssize_t */ -#ifdef PY_SSIZE_T_CLEAN -#define PyArg_Parse _PyArg_Parse_SizeT -#define PyArg_ParseTuple _PyArg_ParseTuple_SizeT -#define PyArg_ParseTupleAndKeywords _PyArg_ParseTupleAndKeywords_SizeT -#define PyArg_VaParse _PyArg_VaParse_SizeT -#define PyArg_VaParseTupleAndKeywords _PyArg_VaParseTupleAndKeywords_SizeT -#define Py_BuildValue _Py_BuildValue_SizeT -#define Py_VaBuildValue _Py_VaBuildValue_SizeT -#endif - -/* Due to a glitch in 3.2, the _SizeT versions weren't exported from the DLL. */ -#if !defined(PY_SSIZE_T_CLEAN) || !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...); PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...); PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *, - const char *, char **, ...); + const char *, char **, ...); PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list); PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, - const char *, char **, va_list); -#endif + const char *, char **, va_list); + PyAPI_FUNC(int) PyArg_ValidateKeywordArguments(PyObject *); PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...); PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...); -PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...); - - PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list); // Add an attribute with name 'name' and value 'obj' to the module 'mod. |