summaryrefslogtreecommitdiffstats
path: root/Modules/expat/expat_external.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-06-14 22:54:36 (GMT)
committerGitHub <noreply@github.com>2017-06-14 22:54:36 (GMT)
commit23ec4b57e1359f9c539b8defc317542173ae087e (patch)
tree4da31b261e47f72633b4fee215dc804c41541190 /Modules/expat/expat_external.h
parentf7e07840d725f2ebb469129cb5e6574ce61725ef (diff)
downloadcpython-23ec4b57e1359f9c539b8defc317542173ae087e.zip
cpython-23ec4b57e1359f9c539b8defc317542173ae087e.tar.gz
cpython-23ec4b57e1359f9c539b8defc317542173ae087e.tar.bz2
bpo-29591: Upgrade Modules/expat to libexpat 2.2 (#2164)
* bpo-29591: Upgrade Modules/expat to libexpat 2.2 * bpo-29591: Restore Python changes on expat * bpo-29591: Remove expat config of unsupported platforms Remove the configuration (Modules/expat/*config.h) of unsupported platforms: * Amiga * MacOS Classic on PPC32 * Open Watcom * bpo-29591: Remove useless XML_HAS_SET_HASH_SALT The XML_HAS_SET_HASH_SALT define of Modules/expat/expat.h became useless since our local expat copy was upgrade to expat 2.1 (it's now expat 2.2.0).
Diffstat (limited to 'Modules/expat/expat_external.h')
-rw-r--r--Modules/expat/expat_external.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/expat/expat_external.h b/Modules/expat/expat_external.h
index f337e1c..4860c57 100644
--- a/Modules/expat/expat_external.h
+++ b/Modules/expat/expat_external.h
@@ -69,12 +69,26 @@
#endif
#endif /* not defined XML_STATIC */
+#if !defined(XMLIMPORT) && defined(__GNUC__) && (__GNUC__ >= 4)
+#define XMLIMPORT __attribute__ ((visibility ("default")))
+#endif
/* If we didn't define it above, define it away: */
#ifndef XMLIMPORT
#define XMLIMPORT
#endif
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
+#define XML_ATTR_MALLOC __attribute__((__malloc__))
+#else
+#define XML_ATTR_MALLOC
+#endif
+
+#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+#define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
+#else
+#define XML_ATTR_ALLOC_SIZE(x)
+#endif
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL