expat_external.h 3.3 KB

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