blob: c90e4207407f10f3bbe3cf7356cac000420f296b [file] [log] [blame]
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +00001/*
Daniel Veillardbe586972003-11-18 20:56:51 +00002 * Summary: macros for marking symbols as exportable/importable.
3 * Description: macros for marking symbols as exportable/importable.
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +00004 *
Daniel Veillardbe586972003-11-18 20:56:51 +00005 * Copy: See Copyright for the status of this software.
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +00006 *
Daniel Veillardbe586972003-11-18 20:56:51 +00007 * Author: Igor Zlatovic <igor@zlatkovic.com>
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +00008 */
9
10#ifndef __XML_EXPORTS_H__
11#define __XML_EXPORTS_H__
12
13/**
14 * XMLPUBFUN, XMLPUBVAR, XMLCALL
15 *
16 * Macros which declare an exportable function, an exportable variable and
17 * the calling convention used for functions.
18 *
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.
23 */
24
Daniel Veillard7a02cfe2003-09-25 12:18:34 +000025/**
26 * XMLPUBFUN:
27 *
28 * Macros which declare an exportable function
29 */
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000030#define XMLPUBFUN
Daniel Veillard7a02cfe2003-09-25 12:18:34 +000031/**
32 * XMLPUBVAR:
33 *
34 * Macros which declare an exportable variable
35 */
Igor Zlatkoviccd386352003-08-25 10:05:36 +000036#define XMLPUBVAR extern
Daniel Veillard7a02cfe2003-09-25 12:18:34 +000037/**
38 * XMLCALL:
39 *
40 * Macros which declare the called convention for exported functions
41 */
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000042#define XMLCALL
43
44/* Windows platform with MS compiler */
45#if defined(_WIN32) && defined(_MSC_VER)
46 #undef XMLPUBFUN
47 #undef XMLPUBVAR
48 #undef XMLCALL
49 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
50 #define XMLPUBFUN __declspec(dllexport)
51 #define XMLPUBVAR __declspec(dllexport)
52 #else
53 #define XMLPUBFUN
54 #if !defined(LIBXML_STATIC)
55 #define XMLPUBVAR __declspec(dllimport) extern
56 #else
Igor Zlatkovic01d99952003-08-28 16:26:39 +000057 #define XMLPUBVAR extern
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000058 #endif
59 #endif
60 #define XMLCALL __cdecl
Igor Zlatkovic5e483c82003-09-02 14:01:32 +000061 #if !defined _REENTRANT
62 #define _REENTRANT
63 #endif
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000064#endif
65
66/* Windows platform with Borland compiler */
67#if defined(_WIN32) && defined(__BORLANDC__)
68 #undef XMLPUBFUN
69 #undef XMLPUBVAR
70 #undef XMLCALL
71 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
72 #define XMLPUBFUN __declspec(dllexport)
Igor Zlatkovic5b316cd2003-08-27 08:01:18 +000073 #define XMLPUBVAR __declspec(dllexport) extern
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000074 #else
75 #define XMLPUBFUN
76 #if !defined(LIBXML_STATIC)
77 #define XMLPUBVAR __declspec(dllimport) extern
78 #else
Igor Zlatkovic5b316cd2003-08-27 08:01:18 +000079 #define XMLPUBVAR extern
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000080 #endif
81 #endif
82 #define XMLCALL __cdecl
Igor Zlatkovic5e483c82003-09-02 14:01:32 +000083 #if !defined _REENTRANT
84 #define _REENTRANT
85 #endif
86#endif
87
88/* Windows platform with GNU compiler (Mingw) */
89#if defined(_WIN32) && defined(__MINGW__)
90 #if !defined _REENTRANT
91 #define _REENTRANT
92 #endif
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000093#endif
94
95/* Cygwin platform, GNU compiler */
96#if defined(_WIN32) && defined(__CYGWIN__)
97 #undef XMLPUBFUN
98 #undef XMLPUBVAR
99 #undef XMLCALL
100 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
101 #define XMLPUBFUN __declspec(dllexport)
102 #define XMLPUBVAR __declspec(dllexport)
103 #else
104 #define XMLPUBFUN
105 #if !defined(LIBXML_STATIC)
106 #define XMLPUBVAR __declspec(dllimport) extern
107 #else
108 #define XMLPUBVAR
109 #endif
110 #endif
111 #define XMLCALL __cdecl
112#endif
113
114/* Compatibility */
115#if !defined(LIBXML_DLL_IMPORT)
116#define LIBXML_DLL_IMPORT XMLPUBVAR
117#endif
118
119#endif /* __XML_EXPORTS_H__ */
120
121