fixed problems with IPSO build
[public/netxms.git] / src / libexpat / libexpat / expat_external.h
1 /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
2 See the file COPYING for copying permission.
3 */
4
5 #ifndef Expat_External_INCLUDED
6 #define Expat_External_INCLUDED 1
7
8 /* External API definitions */
9
10 #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
11 #define XML_USE_MSC_EXTENSIONS 1
12 #endif
13
14 /* NetXMS node: we use this file only internally in case when Expat
15 is not available on target platform; thus we can use compiler's
16 default calling conventions whatever they are.
17 Leaving XMLCALL defined to __attribute__((cdecl)) with old gcc
18 causes lot of compilation errors; this broke IPSO build.
19 */
20
21 #define XMLCALL
22
23 /* Expat tries very hard to make the API boundary very specifically
24 defined. There are two macros defined to control this boundary;
25 each of these can be defined before including this header to
26 achieve some different behavior, but doing so it not recommended or
27 tested frequently.
28
29 XMLCALL - The calling convention to use for all calls across the
30 "library boundary." This will default to cdecl, and
31 try really hard to tell the compiler that's what we
32 want.
33
34 XMLIMPORT - Whatever magic is needed to note that a function is
35 to be imported from a dynamically loaded library
36 (.dll, .so, or .sl, depending on your platform).
37
38 The XMLCALL macro was added in Expat 1.95.7. The only one which is
39 expected to be directly useful in client code is XMLCALL.
40
41 Note that on at least some Unix versions, the Expat library must be
42 compiled with the cdecl calling convention as the default since
43 system headers may assume the cdecl convention.
44 */
45 #ifndef XMLCALL
46 #if defined(_MSC_VER)
47 #define XMLCALL __cdecl
48 #elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
49 #define XMLCALL __attribute__((cdecl))
50 #else
51 /* For any platform which uses this definition and supports more than
52 one calling convention, we need to extend this definition to
53 declare the convention used on that platform, if it's possible to
54 do so.
55
56 If this is the case for your platform, please file a bug report
57 with information on how to identify your platform via the C
58 pre-processor and how to specify the same calling convention as the
59 platform's malloc() implementation.
60 */
61 #define XMLCALL
62 #endif
63 #endif /* not defined XMLCALL */
64
65
66 #if !defined(XML_STATIC) && !defined(XMLIMPORT)
67 #ifndef XML_BUILDING_EXPAT
68 /* using Expat from an application */
69
70 #ifdef XML_USE_MSC_EXTENSIONS
71 #define XMLIMPORT __declspec(dllimport)
72 #endif
73
74 #endif
75 #endif /* not defined XML_STATIC */
76
77
78 /* If we didn't define it above, define it away: */
79 #ifndef XMLIMPORT
80 #define XMLIMPORT
81 #endif
82
83
84 #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
85
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89
90 #ifdef XML_UNICODE_WCHAR_T
91 #define XML_UNICODE
92 #endif
93
94 #ifdef XML_UNICODE /* Information is UTF-16 encoded. */
95 #ifdef XML_UNICODE_WCHAR_T
96 typedef wchar_t XML_Char;
97 typedef wchar_t XML_LChar;
98 #else
99 typedef unsigned short XML_Char;
100 typedef char XML_LChar;
101 #endif /* XML_UNICODE_WCHAR_T */
102 #else /* Information is UTF-8 encoded. */
103 typedef char XML_Char;
104 typedef char XML_LChar;
105 #endif /* XML_UNICODE */
106
107 #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
108 #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
109 typedef __int64 XML_Index;
110 typedef unsigned __int64 XML_Size;
111 #else
112 typedef long long XML_Index;
113 typedef unsigned long long XML_Size;
114 #endif
115 #else
116 typedef long XML_Index;
117 typedef unsigned long XML_Size;
118 #endif /* XML_LARGE_SIZE */
119
120 #ifdef __cplusplus
121 }
122 #endif
123
124 #endif /* not Expat_External_INCLUDED */