VirtualBox

source: vbox/trunk/src/libs/libxml2-2.13.2/include/libxml/xmlexports.h@ 105451

Last change on this file since 105451 was 105451, checked in by vboxsync, 6 months ago

libxml2-2.13.2: builds and runs on Windows. ​bugref:10730

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette