35
35
36
36
/* External API definitions */
37
37
38
- /* Namespace external symbols to allow multiple libexpat version to
39
- co-exist. */
40
- #include " pyexpatns.h"
41
-
42
38
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
43
- #define XML_USE_MSC_EXTENSIONS 1
39
+ # define XML_USE_MSC_EXTENSIONS 1
44
40
#endif
45
41
46
42
/* Expat tries very hard to make the API boundary very specifically
66
62
system headers may assume the cdecl convention.
67
63
*/
68
64
#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
74
70
/* For any platform which uses this definition and supports more than
75
71
one calling convention, we need to extend this definition to
76
72
declare the convention used on that platform, if it's possible to
81
77
pre-processor and how to specify the same calling convention as the
82
78
platform's malloc() implementation.
83
79
*/
84
- #define XMLCALL
85
- #endif
80
+ # define XMLCALL
81
+ # endif
86
82
#endif /* not defined XMLCALL */
87
83
88
84
89
85
#if !defined(XML_STATIC) && !defined(XMLIMPORT)
90
- #ifndef XML_BUILDING_EXPAT
86
+ # ifndef XML_BUILDING_EXPAT
91
87
/* using Expat from an application */
92
88
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
96
92
97
- #endif
93
+ # endif
98
94
#endif /* not defined XML_STATIC */
99
95
100
96
#if !defined(XMLIMPORT) && defined(__GNUC__) && (__GNUC__ >= 4)
101
- #define XMLIMPORT __attribute__ ((visibility (" default" )))
97
+ # define XMLIMPORT __attribute__ ((visibility (" default" )))
102
98
#endif
103
99
104
100
/* If we didn't define it above, define it away: */
105
101
#ifndef XMLIMPORT
106
- #define XMLIMPORT
102
+ # define XMLIMPORT
107
103
#endif
108
104
109
105
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
110
- #define XML_ATTR_MALLOC __attribute__ ((__malloc__))
106
+ # define XML_ATTR_MALLOC __attribute__ ((__malloc__))
111
107
#else
112
- #define XML_ATTR_MALLOC
108
+ # define XML_ATTR_MALLOC
113
109
#endif
114
110
115
111
#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)))
117
113
#else
118
- #define XML_ATTR_ALLOC_SIZE (x )
114
+ # define XML_ATTR_ALLOC_SIZE (x )
119
115
#endif
120
116
121
117
#define XMLPARSEAPI (type ) XMLIMPORT type XMLCALL
@@ -125,33 +121,35 @@ extern "C" {
125
121
#endif
126
122
127
123
#ifdef XML_UNICODE_WCHAR_T
128
- # define XML_UNICODE
124
+ # ifndef XML_UNICODE
125
+ # define XML_UNICODE
126
+ # endif
129
127
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
130
128
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
131
129
# endif
132
130
#endif
133
131
134
132
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
135
- #ifdef XML_UNICODE_WCHAR_T
133
+ # ifdef XML_UNICODE_WCHAR_T
136
134
typedef wchar_t XML_Char;
137
135
typedef wchar_t XML_LChar;
138
- #else
136
+ # else
139
137
typedef unsigned short XML_Char;
140
138
typedef char XML_LChar;
141
- #endif /* XML_UNICODE_WCHAR_T */
139
+ # endif /* XML_UNICODE_WCHAR_T */
142
140
#else /* Information is UTF-8 encoded. */
143
141
typedef char XML_Char;
144
142
typedef char XML_LChar;
145
143
#endif /* XML_UNICODE */
146
144
147
145
#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
149
147
typedef __int64 XML_Index;
150
148
typedef unsigned __int64 XML_Size;
151
- #else
149
+ # else
152
150
typedef long long XML_Index;
153
151
typedef unsigned long long XML_Size;
154
- #endif
152
+ # endif
155
153
#else
156
154
typedef long XML_Index;
157
155
typedef unsigned long XML_Size;
0 commit comments