Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 1 | /* |
Daniel Veillard | be58697 | 2003-11-18 20:56:51 +0000 | [diff] [blame] | 2 | * Summary: macros for marking symbols as exportable/importable. |
| 3 | * Description: macros for marking symbols as exportable/importable. |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 4 | * |
Daniel Veillard | be58697 | 2003-11-18 20:56:51 +0000 | [diff] [blame] | 5 | * Copy: See Copyright for the status of this software. |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 6 | * |
Daniel Veillard | be58697 | 2003-11-18 20:56:51 +0000 | [diff] [blame] | 7 | * Author: Igor Zlatovic <igor@zlatkovic.com> |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 8 | */ |
| 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 Veillard | 7a02cfe | 2003-09-25 12:18:34 +0000 | [diff] [blame] | 25 | /** |
| 26 | * XMLPUBFUN: |
| 27 | * |
| 28 | * Macros which declare an exportable function |
| 29 | */ |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 30 | #define XMLPUBFUN |
Daniel Veillard | 7a02cfe | 2003-09-25 12:18:34 +0000 | [diff] [blame] | 31 | /** |
| 32 | * XMLPUBVAR: |
| 33 | * |
| 34 | * Macros which declare an exportable variable |
| 35 | */ |
Igor Zlatkovic | cd38635 | 2003-08-25 10:05:36 +0000 | [diff] [blame] | 36 | #define XMLPUBVAR extern |
Daniel Veillard | 7a02cfe | 2003-09-25 12:18:34 +0000 | [diff] [blame] | 37 | /** |
| 38 | * XMLCALL: |
| 39 | * |
| 40 | * Macros which declare the called convention for exported functions |
| 41 | */ |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 42 | #define XMLCALL |
| 43 | |
Daniel Veillard | 1e90661 | 2003-12-05 14:57:46 +0000 | [diff] [blame^] | 44 | /** DOC_DISABLE */ |
| 45 | |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 46 | /* 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 Zlatkovic | 01d9995 | 2003-08-28 16:26:39 +0000 | [diff] [blame] | 59 | #define XMLPUBVAR extern |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 60 | #endif |
| 61 | #endif |
| 62 | #define XMLCALL __cdecl |
Igor Zlatkovic | 5e483c8 | 2003-09-02 14:01:32 +0000 | [diff] [blame] | 63 | #if !defined _REENTRANT |
| 64 | #define _REENTRANT |
| 65 | #endif |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 66 | #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 Zlatkovic | 5b316cd | 2003-08-27 08:01:18 +0000 | [diff] [blame] | 75 | #define XMLPUBVAR __declspec(dllexport) extern |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 76 | #else |
| 77 | #define XMLPUBFUN |
| 78 | #if !defined(LIBXML_STATIC) |
| 79 | #define XMLPUBVAR __declspec(dllimport) extern |
| 80 | #else |
Igor Zlatkovic | 5b316cd | 2003-08-27 08:01:18 +0000 | [diff] [blame] | 81 | #define XMLPUBVAR extern |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 82 | #endif |
| 83 | #endif |
| 84 | #define XMLCALL __cdecl |
Igor Zlatkovic | 5e483c8 | 2003-09-02 14:01:32 +0000 | [diff] [blame] | 85 | #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 Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 95 | #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 | |