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