1178848Scokane/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
2178848Scokane   See the file COPYING for copying permission.
3178848Scokane*/
4178848Scokane
5178848Scokane#ifndef Expat_External_INCLUDED
6178848Scokane#define Expat_External_INCLUDED 1
7178848Scokane
8178848Scokane/* External API definitions */
9178848Scokane
10178848Scokane#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
11178848Scokane#define XML_USE_MSC_EXTENSIONS 1
12178848Scokane#endif
13178848Scokane
14178848Scokane/* Expat tries very hard to make the API boundary very specifically
15178848Scokane   defined.  There are two macros defined to control this boundary;
16178848Scokane   each of these can be defined before including this header to
17178848Scokane   achieve some different behavior, but doing so it not recommended or
18178848Scokane   tested frequently.
19178848Scokane
20178848Scokane   XMLCALL    - The calling convention to use for all calls across the
21178848Scokane                "library boundary."  This will default to cdecl, and
22178848Scokane                try really hard to tell the compiler that's what we
23178848Scokane                want.
24178848Scokane
25178848Scokane   XMLIMPORT  - Whatever magic is needed to note that a function is
26178848Scokane                to be imported from a dynamically loaded library
27178848Scokane                (.dll, .so, or .sl, depending on your platform).
28178848Scokane
29178848Scokane   The XMLCALL macro was added in Expat 1.95.7.  The only one which is
30178848Scokane   expected to be directly useful in client code is XMLCALL.
31178848Scokane
32178848Scokane   Note that on at least some Unix versions, the Expat library must be
33178848Scokane   compiled with the cdecl calling convention as the default since
34178848Scokane   system headers may assume the cdecl convention.
35178848Scokane*/
36178848Scokane#ifndef XMLCALL
37178848Scokane#if defined(_MSC_VER)
38178848Scokane#define XMLCALL __cdecl
39178848Scokane#elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
40178848Scokane#define XMLCALL __attribute__((cdecl))
41178848Scokane#else
42178848Scokane/* For any platform which uses this definition and supports more than
43178848Scokane   one calling convention, we need to extend this definition to
44178848Scokane   declare the convention used on that platform, if it's possible to
45178848Scokane   do so.
46178848Scokane
47178848Scokane   If this is the case for your platform, please file a bug report
48178848Scokane   with information on how to identify your platform via the C
49178848Scokane   pre-processor and how to specify the same calling convention as the
50178848Scokane   platform's malloc() implementation.
51178848Scokane*/
52178848Scokane#define XMLCALL
53178848Scokane#endif
54178848Scokane#endif  /* not defined XMLCALL */
55178848Scokane
56178848Scokane
57178848Scokane#if !defined(XML_STATIC) && !defined(XMLIMPORT)
58178848Scokane#ifndef XML_BUILDING_EXPAT
59178848Scokane/* using Expat from an application */
60178848Scokane
61178848Scokane#ifdef XML_USE_MSC_EXTENSIONS
62178848Scokane#define XMLIMPORT __declspec(dllimport)
63178848Scokane#endif
64178848Scokane
65178848Scokane#endif
66178848Scokane#endif  /* not defined XML_STATIC */
67178848Scokane
68178848Scokane
69178848Scokane/* If we didn't define it above, define it away: */
70178848Scokane#ifndef XMLIMPORT
71178848Scokane#define XMLIMPORT
72178848Scokane#endif
73178848Scokane
74178848Scokane
75178848Scokane#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
76178848Scokane
77178848Scokane#ifdef __cplusplus
78178848Scokaneextern "C" {
79178848Scokane#endif
80178848Scokane
81178848Scokane#ifdef XML_UNICODE_WCHAR_T
82178848Scokane#define XML_UNICODE
83178848Scokane#endif
84178848Scokane
85178848Scokane#ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
86178848Scokane#ifdef XML_UNICODE_WCHAR_T
87178848Scokanetypedef wchar_t XML_Char;
88178848Scokanetypedef wchar_t XML_LChar;
89178848Scokane#else
90178848Scokanetypedef unsigned short XML_Char;
91178848Scokanetypedef char XML_LChar;
92178848Scokane#endif /* XML_UNICODE_WCHAR_T */
93178848Scokane#else                  /* Information is UTF-8 encoded. */
94178848Scokanetypedef char XML_Char;
95178848Scokanetypedef char XML_LChar;
96178848Scokane#endif /* XML_UNICODE */
97178848Scokane
98178848Scokane#ifdef XML_LARGE_SIZE  /* Use large integers for file/stream positions. */
99178848Scokane#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
100178848Scokanetypedef __int64 XML_Index;
101178848Scokanetypedef unsigned __int64 XML_Size;
102178848Scokane#else
103178848Scokanetypedef long long XML_Index;
104178848Scokanetypedef unsigned long long XML_Size;
105178848Scokane#endif
106178848Scokane#else
107178848Scokanetypedef long XML_Index;
108178848Scokanetypedef unsigned long XML_Size;
109178848Scokane#endif /* XML_LARGE_SIZE */
110178848Scokane
111178848Scokane#ifdef __cplusplus
112178848Scokane}
113178848Scokane#endif
114178848Scokane
115178848Scokane#endif /* not Expat_External_INCLUDED */
116