Paul Cercueil / libxml2

Dependents:   libiio

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers xmlexports.h Source File

xmlexports.h

00001 /*
00002  * Summary: macros for marking symbols as exportable/importable.
00003  * Description: macros for marking symbols as exportable/importable.
00004  *
00005  * Copy: See Copyright for the status of this software.
00006  *
00007  * Author: Igor Zlatovic <igor@zlatkovic.com>
00008  */
00009 
00010 #ifndef __XML_EXPORTS_H__
00011 #define __XML_EXPORTS_H__
00012 
00013 /**
00014  * XMLPUBFUN, XMLPUBVAR, XMLCALL
00015  *
00016  * Macros which declare an exportable function, an exportable variable and
00017  * the calling convention used for functions.
00018  *
00019  * Please use an extra block for every platform/compiler combination when
00020  * modifying this, rather than overlong #ifdef lines. This helps
00021  * readability as well as the fact that different compilers on the same
00022  * platform might need different definitions.
00023  */
00024 
00025 /**
00026  * XMLPUBFUN:
00027  *
00028  * Macros which declare an exportable function
00029  */
00030 #define XMLPUBFUN
00031 /**
00032  * XMLPUBVAR:
00033  *
00034  * Macros which declare an exportable variable
00035  */
00036 #define XMLPUBVAR extern
00037 /**
00038  * XMLCALL:
00039  *
00040  * Macros which declare the called convention for exported functions
00041  */
00042 #define XMLCALL
00043 /**
00044  * XMLCDECL:
00045  *
00046  * Macro which declares the calling convention for exported functions that
00047  * use '...'.
00048  */
00049 #define XMLCDECL
00050 
00051 /** DOC_DISABLE */
00052 
00053 /* Windows platform with MS compiler */
00054 #if defined(_WIN32) && defined(_MSC_VER)
00055   #undef XMLPUBFUN
00056   #undef XMLPUBVAR
00057   #undef XMLCALL
00058   #undef XMLCDECL
00059   #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
00060     #define XMLPUBFUN __declspec(dllexport)
00061     #define XMLPUBVAR __declspec(dllexport)
00062   #else
00063     #define XMLPUBFUN
00064     #if !defined(LIBXML_STATIC)
00065       #define XMLPUBVAR __declspec(dllimport) extern
00066     #else
00067       #define XMLPUBVAR extern
00068     #endif
00069   #endif
00070   #if defined(LIBXML_FASTCALL)
00071     #define XMLCALL __fastcall
00072   #else
00073     #define XMLCALL __cdecl
00074   #endif
00075   #define XMLCDECL __cdecl
00076   #if !defined _REENTRANT
00077     #define _REENTRANT
00078   #endif
00079 #endif
00080 
00081 /* Windows platform with Borland compiler */
00082 #if defined(_WIN32) && defined(__BORLANDC__)
00083   #undef XMLPUBFUN
00084   #undef XMLPUBVAR
00085   #undef XMLCALL
00086   #undef XMLCDECL
00087   #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
00088     #define XMLPUBFUN __declspec(dllexport)
00089     #define XMLPUBVAR __declspec(dllexport) extern
00090   #else
00091     #define XMLPUBFUN
00092     #if !defined(LIBXML_STATIC)
00093       #define XMLPUBVAR __declspec(dllimport) extern
00094     #else
00095       #define XMLPUBVAR extern
00096     #endif
00097   #endif
00098   #define XMLCALL __cdecl
00099   #define XMLCDECL __cdecl
00100   #if !defined _REENTRANT
00101     #define _REENTRANT
00102   #endif
00103 #endif
00104 
00105 /* Windows platform with GNU compiler (Mingw) */
00106 #if defined(_WIN32) && defined(__MINGW32__)
00107   #undef XMLPUBFUN
00108   #undef XMLPUBVAR
00109   #undef XMLCALL
00110   #undef XMLCDECL
00111   /*
00112    * if defined(IN_LIBXML) this raises problems on mingw with msys
00113    * _imp__xmlFree listed as missing. Try to workaround the problem
00114    * by also making that declaration when compiling client code.
00115    */
00116   #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
00117     #define XMLPUBFUN __declspec(dllexport)
00118     #define XMLPUBVAR __declspec(dllexport) extern
00119   #else
00120     #define XMLPUBFUN
00121     #if !defined(LIBXML_STATIC)
00122       #define XMLPUBVAR __declspec(dllimport) extern
00123     #else
00124       #define XMLPUBVAR extern
00125     #endif
00126   #endif
00127   #define XMLCALL __cdecl
00128   #define XMLCDECL __cdecl
00129   #if !defined _REENTRANT
00130     #define _REENTRANT
00131   #endif
00132 #endif
00133 
00134 /* Cygwin platform, GNU compiler */
00135 #if defined(_WIN32) && defined(__CYGWIN__)
00136   #undef XMLPUBFUN
00137   #undef XMLPUBVAR
00138   #undef XMLCALL
00139   #undef XMLCDECL
00140   #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
00141     #define XMLPUBFUN __declspec(dllexport)
00142     #define XMLPUBVAR __declspec(dllexport)
00143   #else
00144     #define XMLPUBFUN
00145     #if !defined(LIBXML_STATIC)
00146       #define XMLPUBVAR __declspec(dllimport) extern
00147     #else
00148       #define XMLPUBVAR
00149     #endif
00150   #endif
00151   #define XMLCALL __cdecl
00152   #define XMLCDECL __cdecl
00153 #endif
00154 
00155 /* Compatibility */
00156 #if !defined(LIBXML_DLL_IMPORT)
00157 #define LIBXML_DLL_IMPORT XMLPUBVAR
00158 #endif
00159 
00160 #endif /* __XML_EXPORTS_H__ */
00161 
00162 
00163