mirror of
https://github.com/python/cpython.git
synced 2025-10-23 01:43:53 +00:00
gh-137210: Add a struct, slot & function for checking an extension's ABI (GH-137212)
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
This commit is contained in:
parent
c1a9c23195
commit
0c74fc8af0
24 changed files with 654 additions and 8 deletions
|
@ -3263,14 +3263,22 @@ PyUnicode_FromFormat(const char *format, ...)
|
|||
|
||||
int
|
||||
PyUnicodeWriter_Format(PyUnicodeWriter *writer, const char *format, ...)
|
||||
{
|
||||
va_list vargs;
|
||||
va_start(vargs, format);
|
||||
int res = _PyUnicodeWriter_FormatV(writer, format, vargs);
|
||||
va_end(vargs);
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
_PyUnicodeWriter_FormatV(PyUnicodeWriter *writer, const char *format,
|
||||
va_list vargs)
|
||||
{
|
||||
_PyUnicodeWriter *_writer = (_PyUnicodeWriter*)writer;
|
||||
Py_ssize_t old_pos = _writer->pos;
|
||||
|
||||
va_list vargs;
|
||||
va_start(vargs, format);
|
||||
int res = unicode_from_format(_writer, format, vargs);
|
||||
va_end(vargs);
|
||||
|
||||
if (res < 0) {
|
||||
_writer->pos = old_pos;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue