Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75aeaa9

Browse files
committed
Issue #11626: Add _SizeT functions to stable ABI.
1 parent 788306a commit 75aeaa9

5 files changed

Lines changed: 21 additions & 2 deletions

File tree

Include/modsupport.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ extern "C" {
2323
PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list);
2424
#endif
2525

26+
/* Due to a glitch in 3.2, the _SizeT versions weren't exported from the DLL. */
27+
#if !defined(PY_SSIZE_T_CLEAN) || !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
2628
PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
2729
PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
2830
PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
@@ -31,13 +33,14 @@ PyAPI_FUNC(int) PyArg_ValidateKeywordArguments(PyObject *);
3133
PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);
3234
PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
3335
PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);
36+
#endif
3437
#ifndef Py_LIMITED_API
3538
PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
36-
#endif
3739

3840
PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
3941
PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
4042
const char *, char **, va_list);
43+
#endif
4144
PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);
4245

4346
PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *);

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ What's New in Python 3.3.0 Beta 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #11626: Add _SizeT functions to stable ABI.
14+
1315
- Issue #15146: Add PyType_FromSpecWithBases. Patch by Robin Schreiber.
1416

1517
- Issue #15142: Fix reference leak when deallocating instances of types

PC/python3.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,3 +691,9 @@ EXPORTS
691691
_Py_SwappedOp=python33._Py_SwappedOp DATA
692692
_Py_TrueStruct=python33._Py_TrueStruct DATA
693693
_Py_VaBuildValue_SizeT=python33._Py_VaBuildValue_SizeT
694+
_PyArg_Parse_SizeT=python33._PyArg_Parse_SizeT
695+
_PyArg_ParseTuple_SizeT=python33._PyArg_ParseTuple_SizeT
696+
_PyArg_ParseTupleAndKeywords_SizeT=python33._PyArg_ParseTupleAndKeywords_SizeT
697+
_PyArg_VaParse_SizeT=python33._PyArg_VaParse_SizeT
698+
_PyArg_VaParseTupleAndKeywords_SizeT=python33._PyArg_VaParseTupleAndKeywords_SizeT
699+
_Py_BuildValue_SizeT=python33._Py_BuildValue_SizeT

PC/python33gen.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
out.write('EXPORTS\n')
88

99
inp = open("python3.def")
10-
inp.readline()
1110
line = inp.readline()
11+
while line.strip().startswith(';'):
12+
line = inp.readline()
13+
line = inp.readline() # LIBRARY
1214
assert line.strip()=='EXPORTS'
1315

1416
for line in inp:

PC/python33stub.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,3 +690,9 @@ _Py_NotImplementedStruct
690690
_Py_SwappedOp
691691
_Py_TrueStruct
692692
_Py_VaBuildValue_SizeT
693+
_PyArg_Parse_SizeT
694+
_PyArg_ParseTuple_SizeT
695+
_PyArg_ParseTupleAndKeywords_SizeT
696+
_PyArg_VaParse_SizeT
697+
_PyArg_VaParseTupleAndKeywords_SizeT
698+
_Py_BuildValue_SizeT

0 commit comments

Comments
 (0)