Skip to content

Commit 08201b2

Browse files
author
loewis
committed
Patch #554716: Use __va_copy where available.
git-svn-id: http://svn.python.org/projects/python/trunk@27791 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 2cde49b commit 08201b2

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

Objects/abstract.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,8 +1792,12 @@ objargs_mktuple(va_list va)
17921792

17931793
#ifdef VA_LIST_IS_ARRAY
17941794
memcpy(countva, va, sizeof(va_list));
1795+
#else
1796+
#ifdef __va_copy
1797+
__va_copy(countva, va);
17951798
#else
17961799
countva = va;
1800+
#endif
17971801
#endif
17981802

17991803
while (((PyObject *)va_arg(countva, PyObject *)) != NULL)

Objects/stringobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,12 @@ PyString_FromFormatV(const char *format, va_list vargs)
155155

156156
#ifdef VA_LIST_IS_ARRAY
157157
memcpy(count, vargs, sizeof(va_list));
158+
#else
159+
#ifdef __va_copy
160+
__va_copy(count, vargs);
158161
#else
159162
count = vargs;
163+
#endif
160164
#endif
161165
/* step 1: figure out how large a buffer we need */
162166
for (f = format; *f; f++) {

Python/getargs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ PyArg_VaParse(PyObject *args, char *format, va_list va)
6060

6161
#ifdef VA_LIST_IS_ARRAY
6262
memcpy(lva, va, sizeof(va_list));
63+
#else
64+
#ifdef __va_copy
65+
__va_copy(lva, va);
6366
#else
6467
lva = va;
68+
#endif
6569
#endif
6670

6771
return vgetargs1(args, format, &lva, 0);

Python/modsupport.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,12 @@ Py_VaBuildValue(char *format, va_list va)
417417

418418
#ifdef VA_LIST_IS_ARRAY
419419
memcpy(lva, va, sizeof(va_list));
420+
#else
421+
#ifdef __va_copy
422+
__va_copy(lva, va);
420423
#else
421424
lva = va;
425+
#endif
422426
#endif
423427

424428
if (n < 0)

0 commit comments

Comments
 (0)