summaryrefslogtreecommitdiffstats
path: root/Modules/expat
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2019-06-28 03:54:44 (GMT)
committerGitHub <noreply@github.com>2019-06-28 03:54:44 (GMT)
commit3b03b09fc94425915c5b1225e9200a3a95bc827b (patch)
treeef068553e1d0ba55c8a566633466d0b47a1b79ae /Modules/expat
parent44f91c388a6f4da9ed3300df32ca290b8aa104ea (diff)
downloadcpython-3b03b09fc94425915c5b1225e9200a3a95bc827b.zip
cpython-3b03b09fc94425915c5b1225e9200a3a95bc827b.tar.gz
cpython-3b03b09fc94425915c5b1225e9200a3a95bc827b.tar.bz2
closes bpo-37437: Update vendorized expat to 2.2.7. (GH-14436)
Diffstat (limited to 'Modules/expat')
-rw-r--r--Modules/expat/expat.h2
-rw-r--r--Modules/expat/expat_external.h10
-rw-r--r--Modules/expat/internal.h5
-rw-r--r--Modules/expat/winconfig.h4
-rw-r--r--Modules/expat/xmlparse.c29
-rw-r--r--Modules/expat/xmltok.c3
6 files changed, 21 insertions, 32 deletions
diff --git a/Modules/expat/expat.h b/Modules/expat/expat.h
index 174c3fa..c050f1d 100644
--- a/Modules/expat/expat.h
+++ b/Modules/expat/expat.h
@@ -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
}
diff --git a/Modules/expat/expat_external.h b/Modules/expat/expat_external.h
index 2d96b4f..875225d 100644
--- a/Modules/expat/expat_external.h
+++ b/Modules/expat/expat_external.h
@@ -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
diff --git a/Modules/expat/internal.h b/Modules/expat/internal.h
index e33fdcb..dc4ef0c 100644
--- a/Modules/expat/internal.h
+++ b/Modules/expat/internal.h
@@ -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);
diff --git a/Modules/expat/winconfig.h b/Modules/expat/winconfig.h
index 17fea46..28a043c 100644
--- a/Modules/expat/winconfig.h
+++ b/Modules/expat/winconfig.h
@@ -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) */
diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c
index c4f3ffc..9c0987f 100644
--- a/Modules/expat/xmlparse.c
+++ b/Modules/expat/xmlparse.c
@@ -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;
diff --git a/Modules/expat/xmltok.c b/Modules/expat/xmltok.c
index 6371a35..6b415d8 100644
--- a/Modules/expat/xmltok.c
+++ b/Modules/expat/xmltok.c
@@ -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 */