From 75d2d94e0f049162c6ef353a89c5703eb78eaaf6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sun, 28 Jul 2002 10:23:27 +0000 Subject: [PATCH] Patch #554716: Use __va_copy where available. --- Objects/abstract.c | 4 ++++ Objects/stringobject.c | 4 ++++ Python/getargs.c | 4 ++++ Python/modsupport.c | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/Objects/abstract.c b/Objects/abstract.c index 1f9b60346e..fc73a9f0ce 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1792,8 +1792,12 @@ objargs_mktuple(va_list va) #ifdef VA_LIST_IS_ARRAY memcpy(countva, va, sizeof(va_list)); +#else +#ifdef __va_copy + __va_copy(countva, va); #else countva = va; +#endif #endif while (((PyObject *)va_arg(countva, PyObject *)) != NULL) diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 5e40524a0a..bf548cdd26 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -155,8 +155,12 @@ PyString_FromFormatV(const char *format, va_list vargs) #ifdef VA_LIST_IS_ARRAY memcpy(count, vargs, sizeof(va_list)); +#else +#ifdef __va_copy + __va_copy(count, vargs); #else count = vargs; +#endif #endif /* step 1: figure out how large a buffer we need */ for (f = format; *f; f++) { diff --git a/Python/getargs.c b/Python/getargs.c index 280ffc3e46..cc0409dccc 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -60,8 +60,12 @@ PyArg_VaParse(PyObject *args, char *format, va_list va) #ifdef VA_LIST_IS_ARRAY memcpy(lva, va, sizeof(va_list)); +#else +#ifdef __va_copy + __va_copy(lva, va); #else lva = va; +#endif #endif return vgetargs1(args, format, &lva, 0); diff --git a/Python/modsupport.c b/Python/modsupport.c index f4f82982af..1f8ef07d17 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -417,8 +417,12 @@ Py_VaBuildValue(char *format, va_list va) #ifdef VA_LIST_IS_ARRAY memcpy(lva, va, sizeof(va_list)); +#else +#ifdef __va_copy + __va_copy(lva, va); #else lva = va; +#endif #endif if (n < 0) -- 2.50.0