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 | |
| 44 | /* Windows platform with MS compiler */ |
| 45 | #if defined(_WIN32) && defined(_MSC_VER) |
| 46 | #undef XMLPUBFUN |
| 47 | #undef XMLPUBVAR |
| 48 | #undef XMLCALL |
| 49 | #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) |
| 50 | #define XMLPUBFUN __declspec(dllexport) |
| 51 | #define XMLPUBVAR __declspec(dllexport) |
| 52 | #else |
| 53 | #define XMLPUBFUN |
| 54 | #if !defined(LIBXML_STATIC) |
| 55 | #define XMLPUBVAR __declspec(dllimport) extern |
| 56 | #else |
Igor Zlatkovic | 01d9995 | 2003-08-28 16:26:39 +0000 | [diff] [blame] | 57 | #define XMLPUBVAR extern |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 58 | #endif |
| 59 | #endif |
| 60 | #define XMLCALL __cdecl |
Igor Zlatkovic | 5e483c8 | 2003-09-02 14:01:32 +0000 | [diff] [blame] | 61 | #if !defined _REENTRANT |
| 62 | #define _REENTRANT |
| 63 | #endif |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 64 | #endif |
| 65 | |
| 66 | /* Windows platform with Borland compiler */ |
| 67 | #if defined(_WIN32) && defined(__BORLANDC__) |
| 68 | #undef XMLPUBFUN |
| 69 | #undef XMLPUBVAR |
| 70 | #undef XMLCALL |
| 71 | #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) |
| 72 | #define XMLPUBFUN __declspec(dllexport) |
Igor Zlatkovic | 5b316cd | 2003-08-27 08:01:18 +0000 | [diff] [blame] | 73 | #define XMLPUBVAR __declspec(dllexport) extern |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 74 | #else |
| 75 | #define XMLPUBFUN |
| 76 | #if !defined(LIBXML_STATIC) |
| 77 | #define XMLPUBVAR __declspec(dllimport) extern |
| 78 | #else |
Igor Zlatkovic | 5b316cd | 2003-08-27 08:01:18 +0000 | [diff] [blame] | 79 | #define XMLPUBVAR extern |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 80 | #endif |
| 81 | #endif |
| 82 | #define XMLCALL __cdecl |
Igor Zlatkovic | 5e483c8 | 2003-09-02 14:01:32 +0000 | [diff] [blame] | 83 | #if !defined _REENTRANT |
| 84 | #define _REENTRANT |
| 85 | #endif |
| 86 | #endif |
| 87 | |
| 88 | /* Windows platform with GNU compiler (Mingw) */ |
| 89 | #if defined(_WIN32) && defined(__MINGW__) |
| 90 | #if !defined _REENTRANT |
| 91 | #define _REENTRANT |
| 92 | #endif |
Igor Zlatkovic | f05e5d1 | 2003-08-25 09:15:36 +0000 | [diff] [blame] | 93 | #endif |
| 94 | |
| 95 | /* Cygwin platform, GNU compiler */ |
| 96 | #if defined(_WIN32) && defined(__CYGWIN__) |
| 97 | #undef XMLPUBFUN |
| 98 | #undef XMLPUBVAR |
| 99 | #undef XMLCALL |
| 100 | #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) |
| 101 | #define XMLPUBFUN __declspec(dllexport) |
| 102 | #define XMLPUBVAR __declspec(dllexport) |
| 103 | #else |
| 104 | #define XMLPUBFUN |
| 105 | #if !defined(LIBXML_STATIC) |
| 106 | #define XMLPUBVAR __declspec(dllimport) extern |
| 107 | #else |
| 108 | #define XMLPUBVAR |
| 109 | #endif |
| 110 | #endif |
| 111 | #define XMLCALL __cdecl |
| 112 | #endif |
| 113 | |
| 114 | /* Compatibility */ |
| 115 | #if !defined(LIBXML_DLL_IMPORT) |
| 116 | #define LIBXML_DLL_IMPORT XMLPUBVAR |
| 117 | #endif |
| 118 | |
| 119 | #endif /* __XML_EXPORTS_H__ */ |
| 120 | |
| 121 | |