summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-03-15 01:12:23 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-03-15 01:12:23 (GMT)
commit99576c04f19d23eb70d525cae7bd59857153369f (patch)
tree06ff0282133361b4dcfa232c57bdc94cb55078bc /Modules
parentd0e1a5b24196208c38d57d4512a6181a0f5dddf7 (diff)
downloadcpython-99576c04f19d23eb70d525cae7bd59857153369f.zip
cpython-99576c04f19d23eb70d525cae7bd59857153369f.tar.gz
cpython-99576c04f19d23eb70d525cae7bd59857153369f.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/expat/expat.h2
-rw-r--r--Modules/pyexpat.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/Modules/expat/expat.h b/Modules/expat/expat.h
index cffdb8f..89646d2 100644
--- a/Modules/expat/expat.h
+++ b/Modules/expat/expat.h
@@ -892,6 +892,8 @@ XMLPARSEAPI(int)
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
index 3cbe81c..976908c 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1302,8 +1302,13 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
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