blob: 8d6791d5b00dfde197208674028e1ba57a49e833 [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
Daniel Veillard1e906612003-12-05 14:57:46 +000044/** DOC_DISABLE */
45
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000046/* Windows platform with MS compiler */
47#if defined(_WIN32) && defined(_MSC_VER)
48 #undef XMLPUBFUN
49 #undef XMLPUBVAR
50 #undef XMLCALL
51 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
52 #define XMLPUBFUN __declspec(dllexport)
53 #define XMLPUBVAR __declspec(dllexport)
54 #else
55 #define XMLPUBFUN
56 #if !defined(LIBXML_STATIC)
57 #define XMLPUBVAR __declspec(dllimport) extern
58 #else
Igor Zlatkovic01d99952003-08-28 16:26:39 +000059 #define XMLPUBVAR extern
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000060 #endif
61 #endif
62 #define XMLCALL __cdecl
Igor Zlatkovic5e483c82003-09-02 14:01:32 +000063 #if !defined _REENTRANT
64 #define _REENTRANT
65 #endif
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000066#endif
67
68/* Windows platform with Borland compiler */
69#if defined(_WIN32) && defined(__BORLANDC__)
70 #undef XMLPUBFUN
71 #undef XMLPUBVAR
72 #undef XMLCALL
73 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
74 #define XMLPUBFUN __declspec(dllexport)
Igor Zlatkovic5b316cd2003-08-27 08:01:18 +000075 #define XMLPUBVAR __declspec(dllexport) extern
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000076 #else
77 #define XMLPUBFUN
78 #if !defined(LIBXML_STATIC)
79 #define XMLPUBVAR __declspec(dllimport) extern
80 #else
Igor Zlatkovic5b316cd2003-08-27 08:01:18 +000081 #define XMLPUBVAR extern
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000082 #endif
83 #endif
84 #define XMLCALL __cdecl
Igor Zlatkovic5e483c82003-09-02 14:01:32 +000085 #if !defined _REENTRANT
86 #define _REENTRANT
87 #endif
88#endif
89
90/* Windows platform with GNU compiler (Mingw) */
91#if defined(_WIN32) && defined(__MINGW__)
92 #if !defined _REENTRANT
93 #define _REENTRANT
94 #endif
Igor Zlatkovicf05e5d12003-08-25 09:15:36 +000095#endif
96
97/* Cygwin platform, GNU compiler */
98#if defined(_WIN32) && defined(__CYGWIN__)
99 #undef XMLPUBFUN
100 #undef XMLPUBVAR
101 #undef XMLCALL
102 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
103 #define XMLPUBFUN __declspec(dllexport)
104 #define XMLPUBVAR __declspec(dllexport)
105 #else
106 #define XMLPUBFUN
107 #if !defined(LIBXML_STATIC)
108 #define XMLPUBVAR __declspec(dllimport) extern
109 #else
110 #define XMLPUBVAR
111 #endif
112 #endif
113 #define XMLCALL __cdecl
114#endif
115
116/* Compatibility */
117#if !defined(LIBXML_DLL_IMPORT)
118#define LIBXML_DLL_IMPORT XMLPUBVAR
119#endif
120
121#endif /* __XML_EXPORTS_H__ */
122
123