xmlexports.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * Summary: macros for marking symbols as exportable/importable.
  3. * Description: macros for marking symbols as exportable/importable.
  4. *
  5. * Copy: See Copyright for the status of this software.
  6. *
  7. * Author: Igor Zlatovic <igor@zlatkovic.com>
  8. */
  9. #ifndef __XML_EXPORTS_H__
  10. #define __XML_EXPORTS_H__
  11. /**
  12. * XMLPUBFUN, XMLPUBVAR, XMLCALL
  13. *
  14. * Macros which declare an exportable function, an exportable variable and
  15. * the calling convention used for functions.
  16. *
  17. * Please use an extra block for every platform/compiler combination when
  18. * modifying this, rather than overlong #ifdef lines. This helps
  19. * readability as well as the fact that different compilers on the same
  20. * platform might need different definitions.
  21. */
  22. /**
  23. * XMLPUBFUN:
  24. *
  25. * Macros which declare an exportable function
  26. */
  27. #define XMLPUBFUN
  28. /**
  29. * XMLPUBVAR:
  30. *
  31. * Macros which declare an exportable variable
  32. */
  33. #define XMLPUBVAR extern
  34. /**
  35. * XMLCALL:
  36. *
  37. * Macros which declare the called convention for exported functions
  38. */
  39. #define XMLCALL
  40. /**
  41. * XMLCDECL:
  42. *
  43. * Macro which declares the calling convention for exported functions that
  44. * use '...'.
  45. */
  46. #define XMLCDECL
  47. /** DOC_DISABLE */
  48. /* Windows platform with MS compiler */
  49. #if defined(_WIN32) && defined(_MSC_VER)
  50. #undef XMLPUBFUN
  51. #undef XMLPUBVAR
  52. #undef XMLCALL
  53. #undef XMLCDECL
  54. #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
  55. #define XMLPUBFUN __declspec(dllexport)
  56. #define XMLPUBVAR __declspec(dllexport)
  57. #else
  58. #define XMLPUBFUN
  59. #if !defined(LIBXML_STATIC)
  60. #define XMLPUBVAR __declspec(dllimport) extern
  61. #else
  62. #define XMLPUBVAR extern
  63. #endif
  64. #endif
  65. #if defined(LIBXML_FASTCALL)
  66. #define XMLCALL __fastcall
  67. #else
  68. #define XMLCALL __cdecl
  69. #endif
  70. #define XMLCDECL __cdecl
  71. #if !defined _REENTRANT
  72. #define _REENTRANT
  73. #endif
  74. #endif
  75. /* Windows platform with Borland compiler */
  76. #if defined(_WIN32) && defined(__BORLANDC__)
  77. #undef XMLPUBFUN
  78. #undef XMLPUBVAR
  79. #undef XMLCALL
  80. #undef XMLCDECL
  81. #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
  82. #define XMLPUBFUN __declspec(dllexport)
  83. #define XMLPUBVAR __declspec(dllexport) extern
  84. #else
  85. #define XMLPUBFUN
  86. #if !defined(LIBXML_STATIC)
  87. #define XMLPUBVAR __declspec(dllimport) extern
  88. #else
  89. #define XMLPUBVAR extern
  90. #endif
  91. #endif
  92. #define XMLCALL __cdecl
  93. #define XMLCDECL __cdecl
  94. #if !defined _REENTRANT
  95. #define _REENTRANT
  96. #endif
  97. #endif
  98. /* Windows platform with GNU compiler (Mingw) */
  99. #if defined(_WIN32) && defined(__MINGW32__)
  100. #undef XMLPUBFUN
  101. #undef XMLPUBVAR
  102. #undef XMLCALL
  103. #undef XMLCDECL
  104. /*
  105. * if defined(IN_LIBXML) this raises problems on mingw with msys
  106. * _imp__xmlFree listed as missing. Try to workaround the problem
  107. * by also making that declaration when compiling client code.
  108. */
  109. #if !defined(LIBXML_STATIC)
  110. #define XMLPUBFUN __declspec(dllexport)
  111. #define XMLPUBVAR __declspec(dllexport)
  112. #else
  113. #define XMLPUBFUN
  114. #if !defined(LIBXML_STATIC)
  115. #define XMLPUBVAR __declspec(dllimport) extern
  116. #else
  117. #define XMLPUBVAR extern
  118. #endif
  119. #endif
  120. #define XMLCALL __cdecl
  121. #define XMLCDECL __cdecl
  122. #if !defined _REENTRANT
  123. #define _REENTRANT
  124. #endif
  125. #endif
  126. /* Cygwin platform, GNU compiler */
  127. #if defined(_WIN32) && defined(__CYGWIN__)
  128. #undef XMLPUBFUN
  129. #undef XMLPUBVAR
  130. #undef XMLCALL
  131. #undef XMLCDECL
  132. #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
  133. #define XMLPUBFUN __declspec(dllexport)
  134. #define XMLPUBVAR __declspec(dllexport)
  135. #else
  136. #define XMLPUBFUN
  137. #if !defined(LIBXML_STATIC)
  138. #define XMLPUBVAR __declspec(dllimport) extern
  139. #else
  140. #define XMLPUBVAR
  141. #endif
  142. #endif
  143. #define XMLCALL __cdecl
  144. #define XMLCDECL __cdecl
  145. #endif
  146. /* Compatibility */
  147. #if !defined(LIBXML_DLL_IMPORT)
  148. #define LIBXML_DLL_IMPORT XMLPUBVAR
  149. #endif
  150. #endif /* __XML_EXPORTS_H__ */