4 / _ \\ /| '_ \ / _` | __|
5 | __// \| |_) | (_| | |_
6 \___/_/\_\ .__/ \__,_|\__|
9 Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
10 Copyright (c) 2000-2017 Expat development team
11 Licensed under the MIT license:
13 Permission is hereby granted, free of charge, to any person obtaining
14 a copy of this software and associated documentation files (the
15 "Software"), to deal in the Software without restriction, including
16 without limitation the rights to use, copy, modify, merge, publish,
17 distribute, sublicense, and/or sell copies of the Software, and to permit
18 persons to whom the Software is furnished to do so, subject to the
21 The above copyright notice and this permission notice shall be included
22 in all copies or substantial portions of the Software.
24 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
27 NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
28 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
29 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
30 USE OR OTHER DEALINGS IN THE SOFTWARE.
33 #ifndef Expat_External_INCLUDED
34 #define Expat_External_INCLUDED 1
36 /* External API definitions */
38 /* Expat tries very hard to make the API boundary very specifically
39 defined. There are two macros defined to control this boundary;
40 each of these can be defined before including this header to
41 achieve some different behavior, but doing so it not recommended or
44 XMLCALL - The calling convention to use for all calls across the
45 "library boundary." This will default to cdecl, and
46 try really hard to tell the compiler that's what we
49 XMLIMPORT - Whatever magic is needed to note that a function is
50 to be imported from a dynamically loaded library
51 (.dll, .so, or .sl, depending on your platform).
53 The XMLCALL macro was added in Expat 1.95.7. The only one which is
54 expected to be directly useful in client code is XMLCALL.
56 Note that on at least some Unix versions, the Expat library must be
57 compiled with the cdecl calling convention as the default since
58 system headers may assume the cdecl convention.
61 # if defined(_MSC_VER)
62 # define XMLCALL __cdecl
63 # elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)
64 # define XMLCALL __attribute__((cdecl))
66 /* For any platform which uses this definition and supports more than
67 one calling convention, we need to extend this definition to
68 declare the convention used on that platform, if it's possible to
71 If this is the case for your platform, please file a bug report
72 with information on how to identify your platform via the C
73 pre-processor and how to specify the same calling convention as the
74 platform's malloc() implementation.
78 #endif /* not defined XMLCALL */
80 #if ! defined(XML_STATIC) && ! defined(XMLIMPORT)
81 # ifndef XML_BUILDING_EXPAT
82 /* using Expat from an application */
84 # if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__)
85 # define XMLIMPORT __declspec(dllimport)
89 #endif /* not defined XML_STATIC */
91 #ifndef XML_ENABLE_VISIBILITY
92 # define XML_ENABLE_VISIBILITY 0
95 #if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
96 # define XMLIMPORT __attribute__((visibility("default")))
99 /* If we didn't define it above, define it away: */
104 #if defined(__GNUC__) \
105 && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
106 # define XML_ATTR_MALLOC __attribute__((__malloc__))
108 # define XML_ATTR_MALLOC
111 #if defined(__GNUC__) \
112 && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
113 # define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
115 # define XML_ATTR_ALLOC_SIZE(x)
118 #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
124 #ifdef XML_UNICODE_WCHAR_T
128 # if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
129 # error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
133 #ifdef XML_UNICODE /* Information is UTF-16 encoded. */
134 # ifdef XML_UNICODE_WCHAR_T
135 typedef wchar_t XML_Char;
136 typedef wchar_t XML_LChar;
138 typedef unsigned short XML_Char;
139 typedef char XML_LChar;
140 # endif /* XML_UNICODE_WCHAR_T */
141 #else /* Information is UTF-8 encoded. */
142 typedef char XML_Char;
143 typedef char XML_LChar;
144 #endif /* XML_UNICODE */
146 #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
147 typedef long long XML_Index;
148 typedef unsigned long long XML_Size;
150 typedef long XML_Index;
151 typedef unsigned long XML_Size;
152 #endif /* XML_LARGE_SIZE */
158 #endif /* not Expat_External_INCLUDED */