Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e21100

Browse files
authored
bpo-33956: update vendored expat to 2.2.5 (GH-7925)
1 parent 58ed730 commit 4e21100

File tree

9 files changed

+1354
-1465
lines changed

9 files changed

+1354
-1465
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update vendored Expat library copy to version 2.2.5.

Modules/expat/expat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ XML_GetFeatureList(void);
10761076
*/
10771077
#define XML_MAJOR_VERSION 2
10781078
#define XML_MINOR_VERSION 2
1079-
#define XML_MICRO_VERSION 4
1079+
#define XML_MICRO_VERSION 5
10801080

10811081
#ifdef __cplusplus
10821082
}

Modules/expat/expat_external.h

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@
3535

3636
/* External API definitions */
3737

38-
/* Namespace external symbols to allow multiple libexpat version to
39-
co-exist. */
40-
#include "pyexpatns.h"
41-
4238
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
43-
#define XML_USE_MSC_EXTENSIONS 1
39+
# define XML_USE_MSC_EXTENSIONS 1
4440
#endif
4541

4642
/* Expat tries very hard to make the API boundary very specifically
@@ -66,11 +62,11 @@
6662
system headers may assume the cdecl convention.
6763
*/
6864
#ifndef XMLCALL
69-
#if defined(_MSC_VER)
70-
#define XMLCALL __cdecl
71-
#elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
72-
#define XMLCALL __attribute__((cdecl))
73-
#else
65+
# if defined(_MSC_VER)
66+
# define XMLCALL __cdecl
67+
# elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
68+
# define XMLCALL __attribute__((cdecl))
69+
# else
7470
/* For any platform which uses this definition and supports more than
7571
one calling convention, we need to extend this definition to
7672
declare the convention used on that platform, if it's possible to
@@ -81,41 +77,41 @@
8177
pre-processor and how to specify the same calling convention as the
8278
platform's malloc() implementation.
8379
*/
84-
#define XMLCALL
85-
#endif
80+
# define XMLCALL
81+
# endif
8682
#endif /* not defined XMLCALL */
8783

8884

8985
#if !defined(XML_STATIC) && !defined(XMLIMPORT)
90-
#ifndef XML_BUILDING_EXPAT
86+
# ifndef XML_BUILDING_EXPAT
9187
/* using Expat from an application */
9288

93-
#ifdef XML_USE_MSC_EXTENSIONS
94-
#define XMLIMPORT __declspec(dllimport)
95-
#endif
89+
# ifdef XML_USE_MSC_EXTENSIONS
90+
# define XMLIMPORT __declspec(dllimport)
91+
# endif
9692

97-
#endif
93+
# endif
9894
#endif /* not defined XML_STATIC */
9995

10096
#if !defined(XMLIMPORT) && defined(__GNUC__) && (__GNUC__ >= 4)
101-
#define XMLIMPORT __attribute__ ((visibility ("default")))
97+
# define XMLIMPORT __attribute__ ((visibility ("default")))
10298
#endif
10399

104100
/* If we didn't define it above, define it away: */
105101
#ifndef XMLIMPORT
106-
#define XMLIMPORT
102+
# define XMLIMPORT
107103
#endif
108104

109105
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
110-
#define XML_ATTR_MALLOC __attribute__((__malloc__))
106+
# define XML_ATTR_MALLOC __attribute__((__malloc__))
111107
#else
112-
#define XML_ATTR_MALLOC
108+
# define XML_ATTR_MALLOC
113109
#endif
114110

115111
#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
116-
#define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
112+
# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
117113
#else
118-
#define XML_ATTR_ALLOC_SIZE(x)
114+
# define XML_ATTR_ALLOC_SIZE(x)
119115
#endif
120116

121117
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
@@ -125,33 +121,35 @@ extern "C" {
125121
#endif
126122

127123
#ifdef XML_UNICODE_WCHAR_T
128-
# define XML_UNICODE
124+
# ifndef XML_UNICODE
125+
# define XML_UNICODE
126+
# endif
129127
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
130128
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
131129
# endif
132130
#endif
133131

134132
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
135-
#ifdef XML_UNICODE_WCHAR_T
133+
# ifdef XML_UNICODE_WCHAR_T
136134
typedef wchar_t XML_Char;
137135
typedef wchar_t XML_LChar;
138-
#else
136+
# else
139137
typedef unsigned short XML_Char;
140138
typedef char XML_LChar;
141-
#endif /* XML_UNICODE_WCHAR_T */
139+
# endif /* XML_UNICODE_WCHAR_T */
142140
#else /* Information is UTF-8 encoded. */
143141
typedef char XML_Char;
144142
typedef char XML_LChar;
145143
#endif /* XML_UNICODE */
146144

147145
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
148-
#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
146+
# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
149147
typedef __int64 XML_Index;
150148
typedef unsigned __int64 XML_Size;
151-
#else
149+
# else
152150
typedef long long XML_Index;
153151
typedef unsigned long long XML_Size;
154-
#endif
152+
# endif
155153
#else
156154
typedef long XML_Index;
157155
typedef unsigned long XML_Size;

Modules/expat/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ extern "C" {
116116

117117

118118
void
119-
align_limit_to_full_utf8_characters(const char * from, const char ** fromLimRef);
119+
_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef);
120120

121121

122122
#ifdef __cplusplus

Modules/expat/loadlibrary.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ HMODULE _Expat_LoadLibrary(LPCTSTR filename)
8484
/* Get a handle to kernel32 so we can access it's functions at runtime */
8585
HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32"));
8686
if(!hKernel32)
87-
return NULL;
87+
return NULL; /* LCOV_EXCL_LINE */
8888

8989
/* Attempt to find LoadLibraryEx() which is only available on Windows 2000
9090
and above */

0 commit comments

Comments
 (0)