2 * Summary: macros for marking symbols as exportable/importable.
3 * Description: macros for marking symbols as exportable/importable.
5 * Copy: See Copyright for the status of this software.
7 * Author: Igor Zlatovic <igor@zlatkovic.com>
10 #ifndef __XML_EXPORTS_H__
11 #define __XML_EXPORTS_H__
14 * XMLPUBFUN, XMLPUBVAR, XMLCALL
16 * Macros which declare an exportable function, an exportable variable and
17 * the calling convention used for functions.
19 * Please use an extra block for every platform/compiler combination when
20 * modifying this, rather than overlong #ifdef lines. This helps
21 * readability as well as the fact that different compilers on the same
22 * platform might need different definitions.
28 * Macros which declare an exportable function
34 * Macros which declare an exportable variable
36 #define XMLPUBVAR extern
40 * Macros which declare the called convention for exported functions
46 * Macro which declares the calling convention for exported functions that
53 /* Windows platform with MS compiler */
54 #if defined(_WIN32) && defined(_MSC_VER)
59 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
60 #define XMLPUBFUN __declspec(dllexport)
61 #define XMLPUBVAR __declspec(dllexport)
64 #if !defined(LIBXML_STATIC)
65 #define XMLPUBVAR __declspec(dllimport) extern
67 #define XMLPUBVAR extern
70 #if defined(LIBXML_FASTCALL)
71 #define XMLCALL __fastcall
73 #define XMLCALL __cdecl
75 #define XMLCDECL __cdecl
76 #if !defined _REENTRANT
81 /* Windows platform with Borland compiler */
82 #if defined(_WIN32) && defined(__BORLANDC__)
87 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
88 #define XMLPUBFUN __declspec(dllexport)
89 #define XMLPUBVAR __declspec(dllexport) extern
92 #if !defined(LIBXML_STATIC)
93 #define XMLPUBVAR __declspec(dllimport) extern
95 #define XMLPUBVAR extern
98 #define XMLCALL __cdecl
99 #define XMLCDECL __cdecl
100 #if !defined _REENTRANT
105 /* Windows platform with GNU compiler (Mingw) */
106 #if defined(_WIN32) && defined(__MINGW32__)
112 * if defined(IN_LIBXML) this raises problems on mingw with msys
113 * _imp__xmlFree listed as missing. Try to workaround the problem
114 * by also making that declaration when compiling client code.
116 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
117 #define XMLPUBFUN __declspec(dllexport)
118 #define XMLPUBVAR __declspec(dllexport) extern
121 #if !defined(LIBXML_STATIC)
122 #define XMLPUBVAR __declspec(dllimport) extern
124 #define XMLPUBVAR extern
127 #define XMLCALL __cdecl
128 #define XMLCDECL __cdecl
129 #if !defined _REENTRANT
134 /* Cygwin platform (does not define _WIN32), GNU compiler */
135 #if defined(__CYGWIN__)
140 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
141 #define XMLPUBFUN __declspec(dllexport)
142 #define XMLPUBVAR __declspec(dllexport)
145 #if !defined(LIBXML_STATIC)
146 #define XMLPUBVAR __declspec(dllimport) extern
148 #define XMLPUBVAR extern
151 #define XMLCALL __cdecl
152 #define XMLCDECL __cdecl
156 #if !defined(LIBXML_DLL_IMPORT)
157 #define LIBXML_DLL_IMPORT XMLPUBVAR
160 #endif /* __XML_EXPORTS_H__ */