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 |
|
---|
8 | #ifndef __XML_EXPORTS_H__
|
---|
9 | #define __XML_EXPORTS_H__
|
---|
10 |
|
---|
11 | /** DOC_DISABLE */
|
---|
12 |
|
---|
13 | /*
|
---|
14 | * Symbol visibility
|
---|
15 | */
|
---|
16 |
|
---|
17 | #if defined(_WIN32) || defined(__CYGWIN__)
|
---|
18 | #ifdef LIBXML_STATIC
|
---|
19 | #define XMLPUBLIC
|
---|
20 | #elif defined(IN_LIBXML)
|
---|
21 | #define XMLPUBLIC __declspec(dllexport)
|
---|
22 | #else
|
---|
23 | #define XMLPUBLIC __declspec(dllimport)
|
---|
24 | #endif
|
---|
25 | #else /* not Windows */
|
---|
26 | #define XMLPUBLIC
|
---|
27 | #endif /* platform switch */
|
---|
28 |
|
---|
29 | #define XMLPUBFUN XMLPUBLIC
|
---|
30 |
|
---|
31 | #define XMLPUBVAR XMLPUBLIC extern
|
---|
32 |
|
---|
33 | /* Compatibility */
|
---|
34 | #define XMLCALL
|
---|
35 | #define XMLCDECL
|
---|
36 | #ifndef LIBXML_DLL_IMPORT
|
---|
37 | #define LIBXML_DLL_IMPORT XMLPUBVAR
|
---|
38 | #endif
|
---|
39 |
|
---|
40 | /*
|
---|
41 | * Attributes
|
---|
42 | */
|
---|
43 | // VBOX. Get rid of warning C4668
|
---|
44 | //#ifndef __GNUC__
|
---|
45 | //#define __GNUC__ 0
|
---|
46 | //#endif
|
---|
47 |
|
---|
48 | #ifndef ATTRIBUTE_UNUSED
|
---|
49 | #if __GNUC__ * 100 + __GNUC_MINOR__ >= 207 || defined(__clang__)
|
---|
50 | #define ATTRIBUTE_UNUSED __attribute__((unused))
|
---|
51 | #else
|
---|
52 | #define ATTRIBUTE_UNUSED
|
---|
53 | #endif
|
---|
54 | #endif
|
---|
55 |
|
---|
56 | #if !defined(__clang__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)
|
---|
57 | #define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
|
---|
58 | #else
|
---|
59 | #define LIBXML_ATTR_ALLOC_SIZE(x)
|
---|
60 | #endif
|
---|
61 |
|
---|
62 | #if __GNUC__ * 100 + __GNUC_MINOR__ >= 303
|
---|
63 | #define LIBXML_ATTR_FORMAT(fmt,args) \
|
---|
64 | __attribute__((__format__(__printf__,fmt,args)))
|
---|
65 | #else
|
---|
66 | #define LIBXML_ATTR_FORMAT(fmt,args)
|
---|
67 | #endif
|
---|
68 |
|
---|
69 | #ifndef XML_DEPRECATED
|
---|
70 | #if defined(IN_LIBXML)
|
---|
71 | #define XML_DEPRECATED
|
---|
72 | #elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301
|
---|
73 | #define XML_DEPRECATED __attribute__((deprecated))
|
---|
74 | #elif _MSC_VER >= 1400
|
---|
75 | /* Available since Visual Studio 2005 */
|
---|
76 | #define XML_DEPRECATED __declspec(deprecated)
|
---|
77 | #else
|
---|
78 | #define XML_DEPRECATED
|
---|
79 | #endif
|
---|
80 | #endif
|
---|
81 |
|
---|
82 | /*
|
---|
83 | * Warnings pragmas, should be moved from public headers
|
---|
84 | */
|
---|
85 |
|
---|
86 | #if defined(__LCC__)
|
---|
87 |
|
---|
88 | #define XML_IGNORE_FPTR_CAST_WARNINGS
|
---|
89 | #define XML_POP_WARNINGS \
|
---|
90 | _Pragma("diag_default 1215")
|
---|
91 |
|
---|
92 | #elif defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
|
---|
93 |
|
---|
94 | #if defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 800)
|
---|
95 | #define XML_IGNORE_FPTR_CAST_WARNINGS \
|
---|
96 | _Pragma("GCC diagnostic push") \
|
---|
97 | _Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
|
---|
98 | _Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
|
---|
99 | #else
|
---|
100 | #define XML_IGNORE_FPTR_CAST_WARNINGS \
|
---|
101 | _Pragma("GCC diagnostic push") \
|
---|
102 | _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
|
---|
103 | #endif
|
---|
104 | #define XML_POP_WARNINGS \
|
---|
105 | _Pragma("GCC diagnostic pop")
|
---|
106 |
|
---|
107 | #elif _MSC_VER >= 1400
|
---|
108 |
|
---|
109 | #define XML_IGNORE_FPTR_CAST_WARNINGS __pragma(warning(push))
|
---|
110 | #define XML_POP_WARNINGS __pragma(warning(pop))
|
---|
111 |
|
---|
112 | #else
|
---|
113 |
|
---|
114 | #define XML_IGNORE_FPTR_CAST_WARNINGS
|
---|
115 | #define XML_POP_WARNINGS
|
---|
116 |
|
---|
117 | #endif
|
---|
118 |
|
---|
119 | /*
|
---|
120 | * Accessors for globals
|
---|
121 | */
|
---|
122 |
|
---|
123 | #define XML_NO_ATTR
|
---|
124 |
|
---|
125 | #ifdef LIBXML_THREAD_ENABLED
|
---|
126 | #define XML_DECLARE_GLOBAL(name, type, attrs) \
|
---|
127 | attrs XMLPUBFUN type *__##name(void);
|
---|
128 | #define XML_GLOBAL_MACRO(name) (*__##name())
|
---|
129 | #else
|
---|
130 | #define XML_DECLARE_GLOBAL(name, type, attrs) \
|
---|
131 | attrs XMLPUBVAR type name;
|
---|
132 | #endif
|
---|
133 |
|
---|
134 | /* bird/VirtualBox: Visibility attributes - start */
|
---|
135 | /* frank: changed to "hidden" */
|
---|
136 | #if defined(VBOX_HAVE_VISIBILITY_HIDDEN) && !defined(LIBXML_STATIC) && defined(IN_LIBXML)
|
---|
137 | #undef XMLPUBFUN
|
---|
138 | #undef XMLPUBVAR
|
---|
139 | #define XMLPUBFUN __attribute__((visibility("hidden")))
|
---|
140 | #define XMLPUBVAR __attribute__((visibility("hidden"))) extern
|
---|
141 | #endif
|
---|
142 | /* bird/VirtualBox: Visibility attributes - end */
|
---|
143 |
|
---|
144 |
|
---|
145 | /*
|
---|
146 | * Originally declared in xmlversion.h which is generated
|
---|
147 | */
|
---|
148 |
|
---|
149 | #ifdef __cplusplus
|
---|
150 | extern "C" {
|
---|
151 | #endif
|
---|
152 |
|
---|
153 | XMLPUBFUN void xmlCheckVersion(int version);
|
---|
154 |
|
---|
155 | #ifdef __cplusplus
|
---|
156 | }
|
---|
157 | #endif
|
---|
158 |
|
---|
159 | #endif /* __XML_EXPORTS_H__ */
|
---|
160 |
|
---|
161 |
|
---|