(original) (raw)
changeset: 75817:d54508a86a5d branch: 3.2 user: Gregory P. Smith greg@krypto.org date: Wed Mar 14 18:10:37 2012 -0700 files: Modules/expat/expat.h Modules/pyexpat.c description: 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. diff -r cf7337a49a07 -r d54508a86a5d Modules/expat/expat.h --- a/Modules/expat/expat.h Thu Mar 15 08:31:00 2012 +0100 +++ b/Modules/expat/expat.h Wed Mar 14 18:10:37 2012 -0700 @@ -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 -r cf7337a49a07 -r d54508a86a5d Modules/pyexpat.c --- a/Modules/pyexpat.c Thu Mar 15 08:31:00 2012 +0100 +++ b/Modules/pyexpat.c Wed Mar 14 18:10:37 2012 -0700 @@ -1150,8 +1150,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); PyObject_GC_Track(self); /greg@krypto.org