Skip to content
Snippets Groups Projects
Commit 124f4c3563bf authored by Nick Wellnhofer's avatar Nick Wellnhofer
Browse files

Simplify xsltexports.h and exsltexports.h

Port the following libxml2 commit to libxslt:

https://gitlab.gnome.org/GNOME/libxml2/-/commit/acdc2ff3607fe003c2febc25f28954146b3c1636

Fixes #71.
parent 86ed8ac0e996
Branches
No related tags found
No related merge requests found
...@@ -2,10 +2,8 @@ ...@@ -2,10 +2,8 @@
* 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__
...@@ -7,18 +5,22 @@ ...@@ -7,18 +5,22 @@
*/ */
#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 */
/** /**
...@@ -23,4 +25,4 @@ ...@@ -23,4 +25,4 @@
/** /**
* EXSLTPUBFUN: * EXSLTPUBLIC:
* *
...@@ -26,3 +28,3 @@ ...@@ -26,3 +28,3 @@
* *
* Macros which declare an exportable function * Macro which declares a public symbol
*/ */
...@@ -28,11 +30,6 @@ ...@@ -28,11 +30,6 @@
*/ */
#define EXSLTPUBFUN #define EXSLTPUBLIC
/**
* EXSLTPUBVAR:
*
* Macros which declare an exportable variable
*/
#define EXSLTPUBVAR extern
/** /**
* EXSLTCALL: * EXSLTCALL:
* *
...@@ -36,7 +33,7 @@ ...@@ -36,7 +33,7 @@
/** /**
* EXSLTCALL: * EXSLTCALL:
* *
* Macros which declare the called convention for exported functions * Macro which declares the calling convention for exported functions
*/ */
#define EXSLTCALL #define EXSLTCALL
...@@ -40,27 +37,5 @@ ...@@ -40,27 +37,5 @@
*/ */
#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
...@@ -66,29 +41,2 @@ ...@@ -66,29 +41,2 @@
/* 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
/* /*
...@@ -94,3 +42,5 @@ ...@@ -94,3 +42,5 @@
/* /*
#if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) * EXSLTPUBFUN:
*
* Macro which declares an exportable function
*/ */
...@@ -96,18 +46,3 @@ ...@@ -96,18 +46,3 @@
*/ */
#if !defined(LIBEXSLT_STATIC) #define EXSLTPUBFUN EXSLTPUBLIC
#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
...@@ -113,22 +48,10 @@ ...@@ -113,22 +48,10 @@
/* 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)
......
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
* 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__
...@@ -8,19 +6,22 @@ ...@@ -8,19 +6,22 @@
*/ */
#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 */
/** /**
...@@ -25,4 +26,4 @@ ...@@ -25,4 +26,4 @@
/** /**
* XSLTPUBFUN: * XSLTPUBLIC:
* *
...@@ -28,3 +29,3 @@ ...@@ -28,3 +29,3 @@
* *
* Macros which declare an exportable function * Macro which declares a public symbol
*/ */
...@@ -30,11 +31,6 @@ ...@@ -30,11 +31,6 @@
*/ */
#define XSLTPUBFUN #define XSLTPUBLIC
/**
* XSLTPUBVAR:
*
* Macros which declare an exportable variable
*/
#define XSLTPUBVAR extern
/** /**
* XSLTCALL: * XSLTCALL:
* *
...@@ -38,7 +34,7 @@ ...@@ -38,7 +34,7 @@
/** /**
* XSLTCALL: * XSLTCALL:
* *
* Macros which declare the called convention for exported functions * Macro which declares the calling convention for exported functions
*/ */
#define XSLTCALL #define XSLTCALL
...@@ -42,27 +38,5 @@ ...@@ -42,27 +38,5 @@
*/ */
#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
...@@ -68,29 +42,2 @@ ...@@ -68,29 +42,2 @@
/* 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
/* /*
...@@ -96,3 +43,5 @@ ...@@ -96,3 +43,5 @@
/* /*
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) * XSLTPUBFUN:
*
* Macro which declares an exportable function
*/ */
...@@ -98,18 +47,3 @@ ...@@ -98,18 +47,3 @@
*/ */
#if !defined(LIBXSLT_STATIC) #define XSLTPUBFUN XSLTPUBLIC
#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
...@@ -115,22 +49,10 @@ ...@@ -115,22 +49,10 @@
/* 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment