parser/expat/lib/expat_external.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial