From: Serhiy Storchaka Date: Tue, 24 Jan 2017 19:39:42 +0000 (+0200) Subject: Issue #29083: Fixed the declaration of some public API functions. X-Git-Tag: v3.7.0a1~1472 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=675f2f8f903b83934e0b0cc0d62f12cee25270d2;p=thirdparty%2FPython%2Fcpython.git Issue #29083: Fixed the declaration of some public API functions. PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and Py_BuildValue() were not available in limited API of version < 3.3 when PY_SSIZE_T_CLEAN is defined. --- 675f2f8f903b83934e0b0cc0d62f12cee25270d2 diff --cc Include/modsupport.h index e464a1cad00e,86719c6e9293..7f4160e5bac6 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@@ -15,15 -15,10 +15,13 @@@ extern "C" #define PyArg_Parse _PyArg_Parse_SizeT #define PyArg_ParseTuple _PyArg_ParseTuple_SizeT #define PyArg_ParseTupleAndKeywords _PyArg_ParseTupleAndKeywords_SizeT - #ifndef Py_LIMITED_API #define PyArg_VaParse _PyArg_VaParse_SizeT #define PyArg_VaParseTupleAndKeywords _PyArg_VaParseTupleAndKeywords_SizeT - #endif /* !Py_LIMITED_API */ #define Py_BuildValue _Py_BuildValue_SizeT #define Py_VaBuildValue _Py_VaBuildValue_SizeT +#ifndef Py_LIMITED_API +#define _Py_VaBuildStack _Py_VaBuildStack_SizeT +#endif #else #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list); @@@ -46,35 -39,12 +48,31 @@@ PyAPI_FUNC(int) PyArg_ValidateKeywordAr 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 *, ...); - #endif + + #ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw); +PyAPI_FUNC(int) _PyArg_UnpackStack( + PyObject **args, + Py_ssize_t nargs, + const char *name, + Py_ssize_t min, + Py_ssize_t max, + ...); + +PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs); +PyAPI_FUNC(int) _PyArg_NoStackKeywords(const char *funcname, PyObject *kwnames); PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); - - PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list); - PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, - const char *, char **, va_list); #endif + PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list); +#ifndef Py_LIMITED_API +PyAPI_FUNC(PyObject **) _Py_VaBuildStack( + PyObject **small_stack, + Py_ssize_t small_stack_len, + const char *format, + va_list va, + Py_ssize_t *p_nargs); +#endif #ifndef Py_LIMITED_API typedef struct _PyArg_Parser { diff --cc Misc/NEWS index 6ce2e3d791cc,faab4df9910b..34d45651af8b --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -623,9 -143,12 +623,15 @@@ Window C API ----- + - Issue #29083: Fixed the declaration of some public API functions. + PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in + limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and + Py_BuildValue() were not available in limited API of version < 3.3 when + PY_SSIZE_T_CLEAN is defined. + +- Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8() + is now of type "const char *" rather of "char *". + - Issue #29058: All stable API extensions added after Python 3.2 are now available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of the minimum Python version supporting this API.