1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-06-13 23:21:33 +03:00

Simplify xsltexports.h and exsltexports.h

Port the following libxml2 commit to libxslt:

acdc2ff360

Fixes #71.
This commit is contained in:
Nick Wellnhofer
2022-07-29 01:28:06 +02:00
parent b7994c3b7a
commit 299238165a
2 changed files with 64 additions and 219 deletions

View File

@ -2,133 +2,56 @@
* Summary: macros for marking symbols as exportable/importable. * Summary: macros for marking symbols as exportable/importable.
* *
* Copy: See Copyright for the status of this software. * Copy: See Copyright for the status of this software.
*
* Author: Igor Zlatkovic <igor@zlatkovic.com>
*/ */
#ifndef __EXSLT_EXPORTS_H__ #ifndef __EXSLT_EXPORTS_H__
#define __EXSLT_EXPORTS_H__ #define __EXSLT_EXPORTS_H__
/** #if defined(_WIN32) || defined(__CYGWIN__)
* EXSLTPUBFUN, EXSLTPUBVAR, EXSLTCALL /** DOC_DISABLE */
*
* Macros which declare an exportable function, an exportable variable and #ifdef LIBEXSLT_STATIC
* the calling convention used for functions. #define EXSLTPUBLIC
* #elif defined(IN_LIBEXSLT)
* Please use an extra block for every platform/compiler combination when #define EXSLTPUBLIC __declspec(dllexport)
* modifying this, rather than overlong #ifdef lines. This helps #else
* readability as well as the fact that different compilers on the same #define EXSLTPUBLIC __declspec(dllimport)
* platform might need different definitions. #endif
*/
#define EXSLTCALL __cdecl
/** DOC_ENABLE */
#else /* not Windows */
/** /**
* EXSLTPUBFUN: * EXSLTPUBLIC:
* *
* Macros which declare an exportable function * Macro which declares a public symbol
*/ */
#define EXSLTPUBFUN #define EXSLTPUBLIC
/**
* EXSLTPUBVAR:
*
* Macros which declare an exportable variable
*/
#define EXSLTPUBVAR extern
/** /**
* EXSLTCALL: * EXSLTCALL:
* *
* Macros which declare the called convention for exported functions * Macro which declares the calling convention for exported functions
*/ */
#define EXSLTCALL #define EXSLTCALL
/** DOC_DISABLE */ #endif /* platform switch */
/* Windows platform with MS compiler */
#if defined(_WIN32) && defined(_MSC_VER)
#undef EXSLTPUBFUN
#undef EXSLTPUBVAR
#undef EXSLTCALL
#if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
#define EXSLTPUBFUN __declspec(dllexport)
#define EXSLTPUBVAR __declspec(dllexport)
#else
#define EXSLTPUBFUN
#if !defined(LIBEXSLT_STATIC)
#define EXSLTPUBVAR __declspec(dllimport) extern
#else
#define EXSLTPUBVAR extern
#endif
#endif
#define EXSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Windows platform with Borland compiler */
#if defined(_WIN32) && defined(__BORLANDC__)
#undef EXSLTPUBFUN
#undef EXSLTPUBVAR
#undef EXSLTCALL
#if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
#define EXSLTPUBFUN __declspec(dllexport)
#define EXSLTPUBVAR __declspec(dllexport) extern
#else
#define EXSLTPUBFUN
#if !defined(LIBEXSLT_STATIC)
#define EXSLTPUBVAR __declspec(dllimport) extern
#else
#define EXSLTPUBVAR extern
#endif
#endif
#define EXSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Windows platform with GNU compiler (Mingw) */
#if defined(_WIN32) && defined(__MINGW32__)
#undef EXSLTPUBFUN
#undef EXSLTPUBVAR
#undef EXSLTCALL
/* /*
#if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) * EXSLTPUBFUN:
*/ *
#if !defined(LIBEXSLT_STATIC) * Macro which declares an exportable function
#define EXSLTPUBFUN __declspec(dllexport) */
#define EXSLTPUBVAR __declspec(dllexport) extern #define EXSLTPUBFUN EXSLTPUBLIC
#else
#define EXSLTPUBFUN
#if !defined(LIBEXSLT_STATIC)
#define EXSLTPUBVAR __declspec(dllimport) extern
#else
#define EXSLTPUBVAR extern
#endif
#endif
#define EXSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Cygwin platform (does not define _WIN32), GNU compiler */ /**
#if defined(__CYGWIN__) * EXSLTPUBVAR:
#undef EXSLTPUBFUN *
#undef EXSLTPUBVAR * Macro which declares an exportable variable
#undef EXSLTCALL */
#if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) #define EXSLTPUBVAR EXSLTPUBLIC extern
#define EXSLTPUBFUN __declspec(dllexport)
#define EXSLTPUBVAR __declspec(dllexport)
#else
#define EXSLTPUBFUN
#if !defined(LIBEXSLT_STATIC)
#define EXSLTPUBVAR __declspec(dllimport) extern
#else
#define EXSLTPUBVAR extern
#endif
#endif
#define EXSLTCALL __cdecl
#endif
/* Compatibility */ /* Compatibility */
#if !defined(LIBEXSLT_PUBLIC) #if !defined(LIBEXSLT_PUBLIC)

View File

@ -3,134 +3,56 @@
* Description: macros for marking symbols as exportable/importable. * Description: macros for marking symbols as exportable/importable.
* *
* Copy: See Copyright for the status of this software. * Copy: See Copyright for the status of this software.
*
* Author: Igor Zlatkovic <igor@zlatkovic.com>
*/ */
#ifndef __XSLT_EXPORTS_H__ #ifndef __XSLT_EXPORTS_H__
#define __XSLT_EXPORTS_H__ #define __XSLT_EXPORTS_H__
/** #if defined(_WIN32) || defined(__CYGWIN__)
* XSLTPUBFUN: /** DOC_DISABLE */
* XSLTPUBFUN, XSLTPUBVAR, XSLTCALL
* #ifdef LIBXSLT_STATIC
* Macros which declare an exportable function, an exportable variable and #define XSLTPUBLIC
* the calling convention used for functions. #elif defined(IN_LIBXSLT)
* #define XSLTPUBLIC __declspec(dllexport)
* Please use an extra block for every platform/compiler combination when #else
* modifying this, rather than overlong #ifdef lines. This helps #define XSLTPUBLIC __declspec(dllimport)
* readability as well as the fact that different compilers on the same #endif
* platform might need different definitions.
*/ #define XSLTCALL __cdecl
/** DOC_ENABLE */
#else /* not Windows */
/** /**
* XSLTPUBFUN: * XSLTPUBLIC:
* *
* Macros which declare an exportable function * Macro which declares a public symbol
*/ */
#define XSLTPUBFUN #define XSLTPUBLIC
/**
* XSLTPUBVAR:
*
* Macros which declare an exportable variable
*/
#define XSLTPUBVAR extern
/** /**
* XSLTCALL: * XSLTCALL:
* *
* Macros which declare the called convention for exported functions * Macro which declares the calling convention for exported functions
*/ */
#define XSLTCALL #define XSLTCALL
/** DOC_DISABLE */ #endif /* platform switch */
/* Windows platform with MS compiler */
#if defined(_WIN32) && defined(_MSC_VER)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport)
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Windows platform with Borland compiler */
#if defined(_WIN32) && defined(__BORLANDC__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport) extern
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Windows platform with GNU compiler (Mingw) */
#if defined(_WIN32) && defined(__MINGW32__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
/* /*
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) * XSLTPUBFUN:
*/ *
#if !defined(LIBXSLT_STATIC) * Macro which declares an exportable function
#define XSLTPUBFUN __declspec(dllexport) */
#define XSLTPUBVAR __declspec(dllexport) extern #define XSLTPUBFUN XSLTPUBLIC
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Cygwin platform (does not define _WIN32), GNU compiler */ /**
#if defined(__CYGWIN__) * XSLTPUBVAR:
#undef XSLTPUBFUN *
#undef XSLTPUBVAR * Macro which declares an exportable variable
#undef XSLTCALL */
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) #define XSLTPUBVAR XSLTPUBLIC extern
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport)
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#endif
/* Compatibility */ /* Compatibility */
#if !defined(LIBXSLT_PUBLIC) #if !defined(LIBXSLT_PUBLIC)