[Python-checkins] cpython (merge 3.6 -> default): merge 3.6

benjamin.peterson python-checkins at python.org
Tue Sep 20 23:39:51 EDT 2016


https://hg.python.org/cpython/rev/73bcce122338
changeset:   103978:73bcce122338
parent:      103976:1cbac6b5d0fb
parent:      103977:278b21d8e86e
user:        Benjamin Peterson <benjamin at python.org>
date:        Tue Sep 20 20:39:44 2016 -0700
summary:
  merge 3.6

files:
  Include/pyport.h        |  10 +-------
  Objects/abstract.c      |   2 +-
  Objects/unicodeobject.c |   5 +--
  Python/getargs.c        |  12 +++++-----
  Python/modsupport.c     |   2 +-
  configure               |  34 -----------------------------
  configure.ac            |  14 -----------
  pyconfig.h.in           |   3 --
  8 files changed, 11 insertions(+), 71 deletions(-)


diff --git a/Include/pyport.h b/Include/pyport.h
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -723,15 +723,7 @@
 #define Py_ULL(x) Py_LL(x##U)
 #endif
 
-#ifdef VA_LIST_IS_ARRAY
-#define Py_VA_COPY(x, y) 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
+#define Py_VA_COPY va_copy
 
 /*
  * Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is
diff --git a/Objects/abstract.c b/Objects/abstract.c
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2683,7 +2683,7 @@
     PyObject **stack;
 
     /* Count the number of arguments */
-    Py_VA_COPY(countva, va);
+    va_copy(countva, va);
 
     n = 0;
     while (1) {
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -2874,9 +2874,8 @@
     writer.min_length = strlen(format) + 100;
     writer.overallocate = 1;
 
-    /* va_list may be an array (of 1 item) on some platforms (ex: AMD64).
-       Copy it to be able to pass a reference to a subfunction. */
-    Py_VA_COPY(vargs2, vargs);
+    // Copy varags to be able to pass a reference to a subfunction.
+    va_copy(vargs2, vargs);
 
     for (f = format; *f; ) {
         if (*f == '%') {
diff --git a/Python/getargs.c b/Python/getargs.c
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -142,7 +142,7 @@
 {
     va_list lva;
 
-        Py_VA_COPY(lva, va);
+    va_copy(lva, va);
 
     return vgetargs1(args, format, &lva, 0);
 }
@@ -152,7 +152,7 @@
 {
     va_list lva;
 
-        Py_VA_COPY(lva, va);
+    va_copy(lva, va);
 
     return vgetargs1(args, format, &lva, FLAG_SIZE_T);
 }
@@ -1402,7 +1402,7 @@
         return 0;
     }
 
-        Py_VA_COPY(lva, va);
+    va_copy(lva, va);
 
     retval = vgetargskeywords(args, keywords, format, kwlist, &lva, 0);
     return retval;
@@ -1426,7 +1426,7 @@
         return 0;
     }
 
-        Py_VA_COPY(lva, va);
+    va_copy(lva, va);
 
     retval = vgetargskeywords(args, keywords, format,
                               kwlist, &lva, FLAG_SIZE_T);
@@ -1531,7 +1531,7 @@
         return 0;
     }
 
-    Py_VA_COPY(lva, va);
+    va_copy(lva, va);
 
     retval = vgetargskeywordsfast(args, keywords, parser, &lva, 0);
     return retval;
@@ -1552,7 +1552,7 @@
         return 0;
     }
 
-    Py_VA_COPY(lva, va);
+    va_copy(lva, va);
 
     retval = vgetargskeywordsfast(args, keywords, parser, &lva, FLAG_SIZE_T);
     return retval;
diff --git a/Python/modsupport.c b/Python/modsupport.c
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -468,7 +468,7 @@
     int n = countformat(f, '\0');
     va_list lva;
 
-    Py_VA_COPY(lva, va);
+    va_copy(lva, va);
 
     if (n < 0)
         return NULL;
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -13543,40 +13543,6 @@
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-va_list_is_array=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether va_list is an array" >&5
-$as_echo_n "checking whether va_list is an array... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#ifdef HAVE_STDARG_PROTOTYPES
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-main ()
-{
-va_list list1, list2; list1 = list2;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-
-
-$as_echo "#define VA_LIST_IS_ARRAY 1" >>confdefs.h
-
- va_list_is_array=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $va_list_is_array" >&5
-$as_echo "$va_list_is_array" >&6; }
-
 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
 
 
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -4040,20 +4040,6 @@
   [AC_MSG_RESULT(no)]
 )
 
-va_list_is_array=no
-AC_MSG_CHECKING(whether va_list is an array)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef HAVE_STDARG_PROTOTYPES
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-]], [[va_list list1, list2; list1 = list2;]])],[],[
- AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
- va_list_is_array=yes
-])
-AC_MSG_RESULT($va_list_is_array)
-
 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
 AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
   [Define this if you have some version of gethostbyname_r()])
diff --git a/pyconfig.h.in b/pyconfig.h.in
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -1361,9 +1361,6 @@
 #endif
 
 
-/* Define if a va_list is an array of some kind */
-#undef VA_LIST_IS_ARRAY
-
 /* Define if you want SIGFPE handled (see Include/pyfpe.h). */
 #undef WANT_SIGFPE_HANDLER
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list