Index: Python/getargs.c =================================================================== --- Python/getargs.c (revision 61893) +++ Python/getargs.c (working copy) @@ -104,15 +104,7 @@ { va_list lva; -#ifdef VA_LIST_IS_ARRAY - memcpy(lva, va, sizeof(va_list)); -#else -#ifdef __va_copy - __va_copy(lva, va); -#else - lva = va; -#endif -#endif + Py_VA_COPY(lva, va); return vgetargs1(args, format, &lva, 0); } @@ -1298,15 +1290,7 @@ return 0; } -#ifdef VA_LIST_IS_ARRAY - memcpy(lva, va, sizeof(va_list)); -#else -#ifdef __va_copy - __va_copy(lva, va); -#else - lva = va; -#endif -#endif + Py_VA_COPY(lva, va); retval = vgetargskeywords(args, keywords, format, kwlist, &lva, 0); return retval; @@ -1330,15 +1314,7 @@ return 0; } -#ifdef VA_LIST_IS_ARRAY - memcpy(lva, va, sizeof(va_list)); -#else -#ifdef __va_copy - __va_copy(lva, va); -#else - lva = va; -#endif -#endif + Py_VA_COPY(lva, va); retval = vgetargskeywords(args, keywords, format, kwlist, &lva, FLAG_SIZE_T); Index: Python/modsupport.c =================================================================== --- Python/modsupport.c (revision 61893) +++ Python/modsupport.c (working copy) @@ -516,15 +516,7 @@ int n = countformat(f, '\0'); va_list lva; -#ifdef VA_LIST_IS_ARRAY - memcpy(lva, va, sizeof(va_list)); -#else -#ifdef __va_copy - __va_copy(lva, va); -#else - lva = va; -#endif -#endif + Py_VA_COPY(lva, va); if (n < 0) return NULL; Index: Include/pyport.h =================================================================== --- Include/pyport.h (revision 61893) +++ Include/pyport.h (working copy) @@ -836,4 +836,14 @@ #define Py_ULL(x) Py_LL(x##U) #endif +#ifdef VA_LIST_IS_ARRAY +#define Py_VA_COPY(x, y) Py_MEMCPY((x), (y), sizeof(va_list)) +#else +#ifdef __va_copy +#define Py_VA_COPY __va_copy +#else +#define Py_VA_COPY(x, y) (x) = (y) +#endif +#endif + #endif /* Py_PYPORT_H */ Index: Objects/abstract.c =================================================================== --- Objects/abstract.c (revision 61893) +++ Objects/abstract.c (working copy) @@ -2652,15 +2652,7 @@ va_list countva; PyObject *result, *tmp; -#ifdef VA_LIST_IS_ARRAY - memcpy(countva, va, sizeof(va_list)); -#else -#ifdef __va_copy - __va_copy(countva, va); -#else - countva = va; -#endif -#endif + Py_VA_COPY(countva, va); while (((PyObject *)va_arg(countva, PyObject *)) != NULL) ++n; Index: Objects/unicodeobject.c =================================================================== --- Objects/unicodeobject.c (revision 61893) +++ Objects/unicodeobject.c (working copy) @@ -593,15 +593,8 @@ char fmt[60]; /* should be enough for %0width.precisionld */ const char *copy; -#ifdef VA_LIST_IS_ARRAY - Py_MEMCPY(count, vargs, sizeof(va_list)); -#else -#ifdef __va_copy - __va_copy(count, vargs); -#else - count = vargs; -#endif -#endif + Py_VA_COPY(count, vargs); + /* step 1: count the number of %S/%R format specifications * (we call PyObject_Str()/PyObject_Repr() for these objects * once during step 3 and put the result in an array) */ Index: Objects/stringobject.c =================================================================== --- Objects/stringobject.c (revision 61893) +++ Objects/stringobject.c (working copy) @@ -162,15 +162,8 @@ char *s; PyObject* string; -#ifdef VA_LIST_IS_ARRAY - Py_MEMCPY(count, vargs, sizeof(va_list)); -#else -#ifdef __va_copy - __va_copy(count, vargs); -#else - count = vargs; -#endif -#endif + Py_VA_COPY(count, vargs); + /* step 1: figure out how large a buffer we need */ for (f = format; *f; f++) { if (*f == '%') {