| 1 | /** |
| 2 | * @file |
| 3 | * |
| 4 | * @brief macros for marking symbols as exportable/importable. |
| 5 | * |
| 6 | * macros for marking symbols as exportable/importable. |
| 7 | * |
| 8 | * @copyright See Copyright for the status of this software. |
| 9 | */ |
| 10 | |
| 11 | #ifndef __XML_EXPORTS_H__ |
| 12 | #define __XML_EXPORTS_H__ |
| 13 | |
| 14 | /* |
| 15 | * Symbol visibility |
| 16 | */ |
| 17 | |
| 18 | #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(LIBXML_STATIC) |
| 19 | #if defined(IN_LIBXML) |
| 20 | #define XMLPUBFUN __declspec(dllexport) |
| 21 | #define XMLPUBVAR __declspec(dllexport) extern |
| 22 | #else |
| 23 | #define XMLPUBFUN __declspec(dllimport) |
| 24 | #define XMLPUBVAR __declspec(dllimport) extern |
| 25 | #endif |
| 26 | #else /* not Windows */ |
| 27 | #define XMLPUBFUN |
| 28 | #define XMLPUBVAR extern |
| 29 | #endif /* platform switch */ |
| 30 | |
| 31 | /* Compatibility */ |
| 32 | #define XMLCALL |
| 33 | #define XMLCDECL |
| 34 | #ifndef LIBXML_DLL_IMPORT |
| 35 | #define LIBXML_DLL_IMPORT XMLPUBVAR |
| 36 | #endif |
| 37 | |
| 38 | /* |
| 39 | * Attributes |
| 40 | */ |
| 41 | |
| 42 | #if !defined(__clang__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403) |
| 43 | #define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x))) |
| 44 | #else |
| 45 | #define LIBXML_ATTR_ALLOC_SIZE(x) |
| 46 | #endif |
| 47 | |
| 48 | #if __GNUC__ * 100 + __GNUC_MINOR__ >= 303 |
| 49 | #define LIBXML_ATTR_FORMAT(fmt,args) \ |
| 50 | __attribute__((__format__(__printf__,fmt,args))) |
| 51 | #else |
| 52 | #define LIBXML_ATTR_FORMAT(fmt,args) |
| 53 | #endif |
| 54 | |
| 55 | #ifndef XML_DEPRECATED |
| 56 | #if defined(IN_LIBXML) |
| 57 | #define XML_DEPRECATED |
| 58 | #elif __GNUC__ * 100 + __GNUC_MINOR__ >= 405 |
| 59 | /* GCC 4.5+ supports deprecated with message */ |
| 60 | #define XML_DEPRECATED __attribute__((deprecated("See https://gnome.pages.gitlab.gnome.org/libxml2/html/deprecated.html"))) |
| 61 | #elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301 |
| 62 | /* GCC 3.1+ supports deprecated without message */ |
| 63 | #define XML_DEPRECATED __attribute__((deprecated)) |
| 64 | #elif defined(_MSC_VER) && _MSC_VER >= 1400 |
| 65 | /* Available since Visual Studio 2005 */ |
| 66 | #define XML_DEPRECATED __declspec(deprecated("See https://gnome.pages.gitlab.gnome.org/libxml2/html/deprecated.html")) |
| 67 | #else |
| 68 | #define XML_DEPRECATED |
| 69 | #endif |
| 70 | #endif |
| 71 | |
| 72 | #ifndef XML_DEPRECATED_MEMBER |
| 73 | #if defined(IN_LIBXML) |
| 74 | #define XML_DEPRECATED_MEMBER |
| 75 | #elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301 |
| 76 | #define XML_DEPRECATED_MEMBER __attribute__((deprecated)) |
| 77 | #else |
| 78 | #define XML_DEPRECATED_MEMBER |
| 79 | #endif |
| 80 | #endif |
| 81 | |
| 82 | /* |
| 83 | * Originally declared in xmlversion.h which is generated |
| 84 | */ |
| 85 | |
| 86 | #ifdef __cplusplus |
| 87 | extern "C" { |
| 88 | #endif |
| 89 | |
| 90 | XMLPUBFUN void xmlCheckVersion(int version); |
| 91 | |
| 92 | #ifdef __cplusplus |
| 93 | } |
| 94 | #endif |
| 95 | |
| 96 | #endif /* __XML_EXPORTS_H__ */ |
| 97 | |
| 98 | |
| 99 | |