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
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
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
136134typedef wchar_t XML_Char;
137135typedef wchar_t XML_LChar;
138- #else
136+ # else
139137typedef unsigned short XML_Char;
140138typedef char XML_LChar;
141- #endif /* XML_UNICODE_WCHAR_T */
139+ # endif /* XML_UNICODE_WCHAR_T */
142140#else /* Information is UTF-8 encoded. */
143141typedef char XML_Char;
144142typedef 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
149147typedef __int64 XML_Index;
150148typedef unsigned __int64 XML_Size;
151- #else
149+ # else
152150typedef long long XML_Index;
153151typedef unsigned long long XML_Size;
154- #endif
152+ # endif
155153#else
156154typedef long XML_Index;
157155typedef unsigned long XML_Size;
0 commit comments