[Python-checkins] cpython (2.7): Fixes Issue 14234: fix for the previous commit, keep compilation when

gregory.p.smith python-checkins at python.org
Thu Mar 15 02:15:32 CET 2012


http://hg.python.org/cpython/rev/cb72aa8a8008
changeset:   75680:cb72aa8a8008
branch:      2.7
parent:      75667:b54f5849013c
user:        Gregory P. Smith <greg at krypto.org>
date:        Wed Mar 14 18:12:23 2012 -0700
summary:
  Fixes Issue 14234: fix for the previous commit, keep compilation when
using --with-system-expat working when the system expat does not have
salted hash support.

files:
  Modules/expat/expat.h |  2 ++
  Modules/pyexpat.c     |  5 +++++
  2 files changed, 7 insertions(+), 0 deletions(-)


diff --git a/Modules/expat/expat.h b/Modules/expat/expat.h
--- a/Modules/expat/expat.h
+++ b/Modules/expat/expat.h
@@ -892,6 +892,8 @@
 XML_SetHashSalt(XML_Parser parser,
                 unsigned long hash_salt);
 
+#define XML_HAS_SET_HASH_SALT  /* Python Only: Defined for pyexpat.c. */
+
 /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
    XML_GetErrorCode returns information about the error.
 */
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1302,8 +1302,13 @@
     else {
         self->itself = XML_ParserCreate(encoding);
     }
+#if ((XML_MAJOR_VERSION >= 2) && (XML_MINOR_VERSION >= 1)) || defined(XML_HAS_SET_HASH_SALT)
+    /* This feature was added upstream in libexpat 2.1.0.  Our expat copy
+     * has a backport of this feature where we also define XML_HAS_SET_HASH_SALT
+     * to indicate that we can still use it. */
     XML_SetHashSalt(self->itself,
                     (unsigned long)_Py_HashSecret.prefix);
+#endif
     self->intern = intern;
     Py_XINCREF(self->intern);
 #ifdef Py_TPFLAGS_HAVE_GC

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


More information about the Python-checkins mailing list