expat_external.h 3.7 KB

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