1 /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
2 See the file COPYING for copying permission.
5 /* External API definitions */
7 #if defined(_MSC_EXTENSIONS) && !(defined(__BEOS__) || defined(__HAIKU__)) && !defined(__CYGWIN__)
8 #define XML_USE_MSC_EXTENSIONS 1
11 /* Expat tries very hard to make the API boundary very specifically
12 defined. There are two macros defined to control this boundary;
13 each of these can be defined before including this header to
14 achieve some different behavior, but doing so it not recommended or
17 XMLCALL - The calling convention to use for all calls across the
18 "library boundary." This will default to cdecl, and
19 try really hard to tell the compiler that's what we
22 XMLIMPORT - Whatever magic is needed to note that a function is
23 to be imported from a dynamically loaded library
24 (.dll, .so, or .sl, depending on your platform).
26 The XMLCALL macro was added in Expat 1.95.7. The only one which is
27 expected to be directly useful in client code is XMLCALL.
29 Note that on at least some Unix versions, the Expat library must be
30 compiled with the cdecl calling convention as the default since
31 system headers may assume the cdecl convention.
34 #if defined(XML_USE_MSC_EXTENSIONS)
35 #define XMLCALL __cdecl
36 #elif defined(__GNUC__) && defined(__i386)
37 #define XMLCALL __attribute__((cdecl))
39 /* For any platform which uses this definition and supports more than
40 one calling convention, we need to extend this definition to
41 declare the convention used on that platform, if it's possible to
44 If this is the case for your platform, please file a bug report
45 with information on how to identify your platform via the C
46 pre-processor and how to specify the same calling convention as the
47 platform's malloc() implementation.
51 #endif /* not defined XMLCALL */
54 #if !defined(XML_STATIC) && !defined(XMLIMPORT)
55 #ifndef XML_BUILDING_EXPAT
56 /* using Expat from an application */
58 #ifdef XML_USE_MSC_EXTENSIONS
59 #define XMLIMPORT __declspec(dllimport)
63 #endif /* not defined XML_STATIC */
65 /* If we didn't define it above, define it away: */
71 #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
77 #ifdef XML_UNICODE_WCHAR_T
81 #ifdef XML_UNICODE /* Information is UTF-16 encoded. */
82 #ifdef XML_UNICODE_WCHAR_T
83 typedef wchar_t XML_Char
;
84 typedef wchar_t XML_LChar
;
86 typedef unsigned short XML_Char
;
87 typedef char XML_LChar
;
88 #endif /* XML_UNICODE_WCHAR_T */
89 #else /* Information is UTF-8 encoded. */
90 typedef char XML_Char
;
91 typedef char XML_LChar
;
92 #endif /* XML_UNICODE */