Skip to content

Commit d75bf44

Browse files
authored
[3.8] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16409)
Fixes CVE-2019-15903. See full changelog at https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/Changes. (cherry picked from commit 52b9408)
1 parent b92b8c5 commit d75bf44

24 files changed

+3974
-4843
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update vendorized expat library version to 2.2.8, which resolves
2+
CVE-2019-15903.

Modules/expat/asciitab.h

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,34 +31,34 @@
3131
*/
3232

3333
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
34-
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
35-
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
36-
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
37-
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
38-
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
39-
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
40-
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
41-
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
42-
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
43-
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
44-
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
45-
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
46-
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
47-
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
48-
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
49-
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
50-
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
51-
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
52-
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
53-
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
54-
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
55-
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
56-
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
57-
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
58-
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
59-
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
60-
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
61-
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
62-
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
63-
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
64-
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
34+
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
35+
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
36+
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
37+
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
38+
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
39+
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
40+
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
41+
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
42+
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
43+
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
44+
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
45+
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
46+
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
47+
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
48+
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
49+
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
50+
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
51+
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
52+
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
53+
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
54+
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
55+
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
56+
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
57+
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
58+
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
59+
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
60+
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
61+
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
62+
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
63+
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
64+
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

Modules/expat/expat.h

Lines changed: 107 additions & 168 deletions
Large diffs are not rendered by default.

Modules/expat/expat_external.h

Lines changed: 45 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535

3636
/* External API definitions */
3737

38-
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
39-
# define XML_USE_MSC_EXTENSIONS 1
40-
#endif
41-
4238
/* Expat tries very hard to make the API boundary very specifically
4339
defined. There are two macros defined to control this boundary;
4440
each of these can be defined before including this header to
@@ -61,12 +57,17 @@
6157
compiled with the cdecl calling convention as the default since
6258
system headers may assume the cdecl convention.
6359
*/
60+
61+
/* Namespace external symbols to allow multiple libexpat version to
62+
co-exist. */
63+
#include "pyexpatns.h"
64+
6465
#ifndef XMLCALL
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
66+
# if defined(_MSC_VER)
67+
# define XMLCALL __cdecl
68+
# elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)
69+
# define XMLCALL __attribute__((cdecl))
70+
# else
7071
/* For any platform which uses this definition and supports more than
7172
one calling convention, we need to extend this definition to
7273
declare the convention used on that platform, if it's possible to
@@ -77,49 +78,46 @@
7778
pre-processor and how to specify the same calling convention as the
7879
platform's malloc() implementation.
7980
*/
80-
# define XMLCALL
81-
# endif
82-
#endif /* not defined XMLCALL */
83-
84-
/* Namespace external symbols to allow multiple libexpat version to
85-
co-exist. */
86-
#include "pyexpatns.h"
87-
81+
# define XMLCALL
82+
# endif
83+
#endif /* not defined XMLCALL */
8884

89-
#if !defined(XML_STATIC) && !defined(XMLIMPORT)
90-
# ifndef XML_BUILDING_EXPAT
85+
#if ! defined(XML_STATIC) && ! defined(XMLIMPORT)
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+
# if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__)
90+
# define XMLIMPORT __declspec(dllimport)
91+
# endif
9692

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

10096
#ifndef XML_ENABLE_VISIBILITY
101-
# define XML_ENABLE_VISIBILITY 0
97+
# define XML_ENABLE_VISIBILITY 0
10298
#endif
10399

104-
#if !defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
105-
# define XMLIMPORT __attribute__ ((visibility ("default")))
100+
#if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
101+
# define XMLIMPORT __attribute__((visibility("default")))
106102
#endif
107103

108104
/* If we didn't define it above, define it away: */
109105
#ifndef XMLIMPORT
110-
# define XMLIMPORT
106+
# define XMLIMPORT
111107
#endif
112108

113-
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
114-
# define XML_ATTR_MALLOC __attribute__((__malloc__))
109+
#if defined(__GNUC__) \
110+
&& (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
111+
# define XML_ATTR_MALLOC __attribute__((__malloc__))
115112
#else
116-
# define XML_ATTR_MALLOC
113+
# define XML_ATTR_MALLOC
117114
#endif
118115

119-
#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
120-
# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
116+
#if defined(__GNUC__) \
117+
&& ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
118+
# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
121119
#else
122-
# define XML_ATTR_ALLOC_SIZE(x)
120+
# define XML_ATTR_ALLOC_SIZE(x)
123121
#endif
124122

125123
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
@@ -129,35 +127,30 @@ extern "C" {
129127
#endif
130128

131129
#ifdef XML_UNICODE_WCHAR_T
132-
# ifndef XML_UNICODE
133-
# define XML_UNICODE
134-
# endif
135-
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
136-
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
137-
# endif
130+
# ifndef XML_UNICODE
131+
# define XML_UNICODE
132+
# endif
133+
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
134+
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
135+
# endif
138136
#endif
139137

140-
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
141-
# ifdef XML_UNICODE_WCHAR_T
138+
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
139+
# ifdef XML_UNICODE_WCHAR_T
142140
typedef wchar_t XML_Char;
143141
typedef wchar_t XML_LChar;
144-
# else
142+
# else
145143
typedef unsigned short XML_Char;
146144
typedef char XML_LChar;
147-
# endif /* XML_UNICODE_WCHAR_T */
148-
#else /* Information is UTF-8 encoded. */
145+
# endif /* XML_UNICODE_WCHAR_T */
146+
#else /* Information is UTF-8 encoded. */
149147
typedef char XML_Char;
150148
typedef char XML_LChar;
151-
#endif /* XML_UNICODE */
149+
#endif /* XML_UNICODE */
152150

153-
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
154-
# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
155-
typedef __int64 XML_Index;
156-
typedef unsigned __int64 XML_Size;
157-
# else
151+
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
158152
typedef long long XML_Index;
159153
typedef unsigned long long XML_Size;
160-
# endif
161154
#else
162155
typedef long XML_Index;
163156
typedef unsigned long XML_Size;

Modules/expat/iasciitab.h

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,34 +32,34 @@
3232

3333
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
3434
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
35-
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
36-
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
37-
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
38-
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
39-
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
40-
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
41-
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
42-
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
43-
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
44-
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
45-
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
46-
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
47-
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
48-
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
49-
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
50-
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
51-
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
52-
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
53-
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
54-
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
55-
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
56-
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
57-
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
58-
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
59-
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
60-
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
61-
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
62-
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
63-
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
64-
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
65-
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
35+
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
36+
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
37+
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
38+
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
39+
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
40+
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
41+
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
42+
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
43+
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
44+
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
45+
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
46+
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
47+
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
48+
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
49+
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
50+
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
51+
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
52+
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
53+
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
54+
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
55+
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
56+
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
57+
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
58+
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
59+
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
60+
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
61+
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
62+
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
63+
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
64+
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
65+
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

Modules/expat/internal.h

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
USE OR OTHER DEALINGS IN THE SOFTWARE.
5050
*/
5151

52-
#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__)
52+
#if defined(__GNUC__) && defined(__i386__) && ! defined(__MINGW32__)
5353
/* We'll use this version by default only where we know it helps.
5454
5555
regparm() generates warnings on Solaris boxes. See SF bug #692878.
@@ -59,8 +59,8 @@
5959
#define FASTCALL __attribute__((stdcall, regparm(3)))
6060
and let's try this:
6161
*/
62-
#define FASTCALL __attribute__((regparm(3)))
63-
#define PTRFASTCALL __attribute__((regparm(3)))
62+
# define FASTCALL __attribute__((regparm(3)))
63+
# define PTRFASTCALL __attribute__((regparm(3)))
6464
#endif
6565

6666
/* Using __fastcall seems to have an unexpected negative effect under
@@ -74,55 +74,49 @@
7474
/* Make sure all of these are defined if they aren't already. */
7575

7676
#ifndef FASTCALL
77-
#define FASTCALL
77+
# define FASTCALL
7878
#endif
7979

8080
#ifndef PTRCALL
81-
#define PTRCALL
81+
# define PTRCALL
8282
#endif
8383

8484
#ifndef PTRFASTCALL
85-
#define PTRFASTCALL
85+
# define PTRFASTCALL
8686
#endif
8787

8888
#ifndef XML_MIN_SIZE
89-
#if !defined(__cplusplus) && !defined(inline)
90-
#ifdef __GNUC__
91-
#define inline __inline
92-
#endif /* __GNUC__ */
93-
#endif
89+
# if ! defined(__cplusplus) && ! defined(inline)
90+
# ifdef __GNUC__
91+
# define inline __inline
92+
# endif /* __GNUC__ */
93+
# endif
9494
#endif /* XML_MIN_SIZE */
9595

9696
#ifdef __cplusplus
97-
#define inline inline
97+
# define inline inline
9898
#else
99-
#ifndef inline
100-
#define inline
101-
#endif
99+
# ifndef inline
100+
# define inline
101+
# endif
102102
#endif
103103

104104
#ifndef UNUSED_P
105-
# ifdef __GNUC__
106-
# define UNUSED_P(p) UNUSED_ ## p __attribute__((__unused__))
107-
# else
108-
# define UNUSED_P(p) UNUSED_ ## p
109-
# endif
105+
# define UNUSED_P(p) (void)p
110106
#endif
111107

112-
113108
#ifdef __cplusplus
114109
extern "C" {
115110
#endif
116111

117-
118112
#ifdef XML_ENABLE_VISIBILITY
119-
#if XML_ENABLE_VISIBILITY
120-
__attribute__ ((visibility ("default")))
121-
#endif
113+
# if XML_ENABLE_VISIBILITY
114+
__attribute__((visibility("default")))
115+
# endif
122116
#endif
123117
void
124-
_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef);
125-
118+
_INTERNAL_trim_to_complete_utf8_characters(const char *from,
119+
const char **fromLimRef);
126120

127121
#ifdef __cplusplus
128122
}

0 commit comments

Comments
 (0)