closes bpo-37437: Update vendorized expat to 2.2.7. (GH-14436)
(cherry picked from commit 3b03b09fc9
)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
This commit is contained in:
parent
4fee28aa42
commit
515a026eb0
|
@ -0,0 +1 @@
|
|||
Update vendorized expat version to 2.2.7.
|
|
@ -1076,7 +1076,7 @@ XML_GetFeatureList(void);
|
|||
*/
|
||||
#define XML_MAJOR_VERSION 2
|
||||
#define XML_MINOR_VERSION 2
|
||||
#define XML_MICRO_VERSION 6
|
||||
#define XML_MICRO_VERSION 7
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -35,10 +35,6 @@
|
|||
|
||||
/* External API definitions */
|
||||
|
||||
/* Namespace external symbols to allow multiple libexpat version to
|
||||
co-exist. */
|
||||
#include "pyexpatns.h"
|
||||
|
||||
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
|
||||
# define XML_USE_MSC_EXTENSIONS 1
|
||||
#endif
|
||||
|
@ -97,7 +93,11 @@
|
|||
# endif
|
||||
#endif /* not defined XML_STATIC */
|
||||
|
||||
#if !defined(XMLIMPORT) && defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#ifndef XML_ENABLE_VISIBILITY
|
||||
# define XML_ENABLE_VISIBILITY 0
|
||||
#endif
|
||||
|
||||
#if !defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
|
||||
# define XMLIMPORT __attribute__ ((visibility ("default")))
|
||||
#endif
|
||||
|
||||
|
|
|
@ -115,6 +115,11 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef XML_ENABLE_VISIBILITY
|
||||
#if XML_ENABLE_VISIBILITY
|
||||
__attribute__ ((visibility ("default")))
|
||||
#endif
|
||||
#endif
|
||||
void
|
||||
_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef);
|
||||
|
||||
|
|
|
@ -53,10 +53,6 @@
|
|||
/* we will assume all Windows platforms are little endian */
|
||||
#define BYTEORDER 1234
|
||||
|
||||
/* Windows has memmove() available. */
|
||||
#define HAVE_MEMMOVE
|
||||
|
||||
|
||||
#endif /* !defined(HAVE_EXPAT_CONFIG_H) */
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* 19ac4776051591216f1874e34ee99b6a43a3784c8bd7d70efeb9258dd22b906a (2.2.6+)
|
||||
/* 69df5be70289a11fb834869ce4a91c23c1d9dd04baffcbd10e86742d149a080c (2.2.7+)
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
|
@ -164,15 +164,6 @@ typedef char ICHAR;
|
|||
/* Do safe (NULL-aware) pointer arithmetic */
|
||||
#define EXPAT_SAFE_PTR_DIFF(p, q) (((p) && (q)) ? ((p) - (q)) : 0)
|
||||
|
||||
/* Handle the case where memmove() doesn't exist. */
|
||||
#ifndef HAVE_MEMMOVE
|
||||
#ifdef HAVE_BCOPY
|
||||
#define memmove(d,s,l) bcopy((s),(d),(l))
|
||||
#else
|
||||
#error memmove does not exist on this platform, nor is a substitute available
|
||||
#endif /* HAVE_BCOPY */
|
||||
#endif /* HAVE_MEMMOVE */
|
||||
|
||||
#include "internal.h"
|
||||
#include "xmltok.h"
|
||||
#include "xmlrole.h"
|
||||
|
@ -747,7 +738,7 @@ writeRandomBytes_dev_urandom(void * target, size_t count) {
|
|||
#endif /* ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM) */
|
||||
|
||||
|
||||
#if defined(HAVE_ARC4RANDOM)
|
||||
#if defined(HAVE_ARC4RANDOM) && ! defined(HAVE_ARC4RANDOM_BUF)
|
||||
|
||||
static void
|
||||
writeRandomBytes_arc4random(void * target, size_t count) {
|
||||
|
@ -765,7 +756,7 @@ writeRandomBytes_arc4random(void * target, size_t count) {
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_ARC4RANDOM) */
|
||||
#endif /* defined(HAVE_ARC4RANDOM) && ! defined(HAVE_ARC4RANDOM_BUF) */
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -3019,7 +3010,7 @@ doContent(XML_Parser parser,
|
|||
enum XML_Error result;
|
||||
if (parser->m_startCdataSectionHandler)
|
||||
parser->m_startCdataSectionHandler(parser->m_handlerArg);
|
||||
#if 0
|
||||
/* BEGIN disabled code */
|
||||
/* Suppose you doing a transformation on a document that involves
|
||||
changing only the character data. You set up a defaultHandler
|
||||
and a characterDataHandler. The defaultHandler simply copies
|
||||
|
@ -3032,9 +3023,9 @@ doContent(XML_Parser parser,
|
|||
However, now we have a start/endCdataSectionHandler, so it seems
|
||||
easier to let the user deal with this.
|
||||
*/
|
||||
else if (parser->m_characterDataHandler)
|
||||
else if (0 && parser->m_characterDataHandler)
|
||||
parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf, 0);
|
||||
#endif
|
||||
/* END disabled code */
|
||||
else if (parser->m_defaultHandler)
|
||||
reportDefault(parser, enc, s, next);
|
||||
result = doCdataSection(parser, enc, &next, end, nextPtr, haveMore);
|
||||
|
@ -3731,11 +3722,11 @@ doCdataSection(XML_Parser parser,
|
|||
case XML_TOK_CDATA_SECT_CLOSE:
|
||||
if (parser->m_endCdataSectionHandler)
|
||||
parser->m_endCdataSectionHandler(parser->m_handlerArg);
|
||||
#if 0
|
||||
/* BEGIN disabled code */
|
||||
/* see comment under XML_TOK_CDATA_SECT_OPEN */
|
||||
else if (parser->m_characterDataHandler)
|
||||
else if (0 && parser->m_characterDataHandler)
|
||||
parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf, 0);
|
||||
#endif
|
||||
/* END disabled code */
|
||||
else if (parser->m_defaultHandler)
|
||||
reportDefault(parser, enc, s, next);
|
||||
*startPtr = next;
|
||||
|
@ -6080,7 +6071,7 @@ setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType)
|
|||
else
|
||||
poolDiscard(&dtd->pool);
|
||||
elementType->prefix = prefix;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#if !defined(_WIN32) && defined(HAVE_EXPAT_CONFIG_H)
|
||||
# include <pyconfig.h>
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
#include <string.h> /* memcpy */
|
||||
|
||||
|
|
Loading…
Reference in New Issue