michael@0: /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd michael@0: See the file COPYING for copying permission. michael@0: */ michael@0: michael@0: #ifndef Expat_External_INCLUDED michael@0: #define Expat_External_INCLUDED 1 michael@0: michael@0: /* External API definitions */ michael@0: michael@0: #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) michael@0: #define XML_USE_MSC_EXTENSIONS 1 michael@0: #endif michael@0: michael@0: /* Expat tries very hard to make the API boundary very specifically michael@0: defined. There are two macros defined to control this boundary; michael@0: each of these can be defined before including this header to michael@0: achieve some different behavior, but doing so it not recommended or michael@0: tested frequently. michael@0: michael@0: XMLCALL - The calling convention to use for all calls across the michael@0: "library boundary." This will default to cdecl, and michael@0: try really hard to tell the compiler that's what we michael@0: want. michael@0: michael@0: XMLIMPORT - Whatever magic is needed to note that a function is michael@0: to be imported from a dynamically loaded library michael@0: (.dll, .so, or .sl, depending on your platform). michael@0: michael@0: The XMLCALL macro was added in Expat 1.95.7. The only one which is michael@0: expected to be directly useful in client code is XMLCALL. michael@0: michael@0: Note that on at least some Unix versions, the Expat library must be michael@0: compiled with the cdecl calling convention as the default since michael@0: system headers may assume the cdecl convention. michael@0: */ michael@0: #ifndef XMLCALL michael@0: #if defined(XML_USE_MSC_EXTENSIONS) michael@0: #define XMLCALL __cdecl michael@0: #elif defined(__GNUC__) && defined(__i386) michael@0: #define XMLCALL __attribute__((cdecl)) michael@0: #else michael@0: /* For any platform which uses this definition and supports more than michael@0: one calling convention, we need to extend this definition to michael@0: declare the convention used on that platform, if it's possible to michael@0: do so. michael@0: michael@0: If this is the case for your platform, please file a bug report michael@0: with information on how to identify your platform via the C michael@0: pre-processor and how to specify the same calling convention as the michael@0: platform's malloc() implementation. michael@0: */ michael@0: #define XMLCALL michael@0: #endif michael@0: #endif /* not defined XMLCALL */ michael@0: michael@0: michael@0: #if !defined(XML_STATIC) && !defined(XMLIMPORT) michael@0: #ifndef XML_BUILDING_EXPAT michael@0: /* using Expat from an application */ michael@0: michael@0: #ifdef XML_USE_MSC_EXTENSIONS michael@0: #define XMLIMPORT __declspec(dllimport) michael@0: #endif michael@0: michael@0: #endif michael@0: #endif /* not defined XML_STATIC */ michael@0: michael@0: michael@0: /* If we didn't define it above, define it away: */ michael@0: #ifndef XMLIMPORT michael@0: #define XMLIMPORT michael@0: #endif michael@0: michael@0: michael@0: #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif michael@0: michael@0: #ifdef XML_UNICODE_WCHAR_T michael@0: #define XML_UNICODE michael@0: #endif michael@0: michael@0: /* BEGIN MOZILLA CHANGE (typedef XML_Char to char16_t) */ michael@0: #if 0 michael@0: michael@0: #ifdef XML_UNICODE /* Information is UTF-16 encoded. */ michael@0: #ifdef XML_UNICODE_WCHAR_T michael@0: typedef wchar_t XML_Char; michael@0: typedef wchar_t XML_LChar; michael@0: #else michael@0: typedef unsigned short XML_Char; michael@0: typedef char XML_LChar; michael@0: #endif /* XML_UNICODE_WCHAR_T */ michael@0: #else /* Information is UTF-8 encoded. */ michael@0: typedef char XML_Char; michael@0: typedef char XML_LChar; michael@0: #endif /* XML_UNICODE */ michael@0: michael@0: #endif michael@0: /* END MOZILLA CHANGE */ michael@0: michael@0: #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ michael@0: #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 michael@0: typedef __int64 XML_Index; michael@0: typedef unsigned __int64 XML_Size; michael@0: #else michael@0: typedef long long XML_Index; michael@0: typedef unsigned long long XML_Size; michael@0: #endif michael@0: #else michael@0: typedef long XML_Index; michael@0: typedef unsigned long XML_Size; michael@0: #endif /* XML_LARGE_SIZE */ michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif michael@0: michael@0: #endif /* not Expat_External_INCLUDED */