Commit c73f6dab authored by Gregory P. Smith's avatar Gregory P. Smith

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.
parent a5d729a7
...@@ -892,6 +892,8 @@ XMLPARSEAPI(int) ...@@ -892,6 +892,8 @@ XMLPARSEAPI(int)
XML_SetHashSalt(XML_Parser parser, XML_SetHashSalt(XML_Parser parser,
unsigned long hash_salt); 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 /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
XML_GetErrorCode returns information about the error. XML_GetErrorCode returns information about the error.
*/ */
......
...@@ -1150,8 +1150,13 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern) ...@@ -1150,8 +1150,13 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
else { else {
self->itself = XML_ParserCreate(encoding); 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, XML_SetHashSalt(self->itself,
(unsigned long)_Py_HashSecret.prefix); (unsigned long)_Py_HashSecret.prefix);
#endif
self->intern = intern; self->intern = intern;
Py_XINCREF(self->intern); Py_XINCREF(self->intern);
PyObject_GC_Track(self); PyObject_GC_Track(self);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment