summarylogtreecommitdiffstats
path: root/bzip2-use-cdecl-calling-convention.patch
diff options
context:
space:
mode:
authorxantares2015-06-08 22:35:17 +0200
committerxantares2015-06-08 22:35:17 +0200
commitaf4d36a44cc5f8dd0a33b3e359118b8345304a6d (patch)
tree1a8f6030cf47d712b2671ea386738fc9e4218cd7 /bzip2-use-cdecl-calling-convention.patch
downloadaur-af4d36a44cc5f8dd0a33b3e359118b8345304a6d.tar.gz
Initial import
Diffstat (limited to 'bzip2-use-cdecl-calling-convention.patch')
-rw-r--r--bzip2-use-cdecl-calling-convention.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/bzip2-use-cdecl-calling-convention.patch b/bzip2-use-cdecl-calling-convention.patch
new file mode 100644
index 000000000000..c9b7f2838813
--- /dev/null
+++ b/bzip2-use-cdecl-calling-convention.patch
@@ -0,0 +1,64 @@
+--- bzip2-1.0.5/bzlib.h 2007-12-09 13:34:39.000000000 +0100
++++ src/bzip2/1.0.5/bzip2-1.0.5/bzlib.h 2008-03-20 20:05:47.000000000 +0100
+@@ -81,18 +81,52 @@
+ /* windows.h define small to char */
+ # undef small
+ # endif
+-# ifdef BZ_EXPORT
+-# define BZ_API(func) WINAPI func
+-# define BZ_EXTERN extern
++//# ifdef BZ_EXPORT
++//# define BZ_API(func) WINAPI func
++//# define BZ_EXTERN extern
++//# else
++// /* import windows dll dynamically */
++//# define BZ_API(func) (WINAPI * func)
++//# define BZ_EXTERN
++//# endif
++//#else
++//# define BZ_API(func) func
++//# define BZ_EXTERN extern
++# include <stdio.h>
++# include <io.h>
++# include <sys/utime.h>
++# define fdopen _fdopen
++# define isatty _isatty
++# define setmode _setmode
++# define utime _utime
++# endif
++
++#ifndef __GNUC__
++# define __DLL_IMPORT__ __declspec(dllimport)
++# define __DLL_EXPORT__ __declspec(dllexport)
+ # else
+- /* import windows dll dynamically */
+-# define BZ_API(func) (WINAPI * func)
+-# define BZ_EXTERN
++# define __DLL_IMPORT__ __attribute__((dllimport)) extern
++# define __DLL_EXPORT__ __attribute__((dllexport)) extern
+ # endif
+-#else
+-# define BZ_API(func) func
+-# define BZ_EXTERN extern
++
++#if (defined __WIN32__) || (defined _WIN32)
++# if defined BUILD_BZIP2_DLL || defined BZ_EXPORT
++# define BZIP2_DLL_IMPEXP __DLL_EXPORT__
++# elif defined(BZIP2_STATIC)
++# define BZIP2_DLL_IMPEXP
++# elif defined (USE_BZIP2_DLL) || defined BZ_IMPORT
++# define BZIP2_DLL_IMPEXP __DLL_IMPORT__
++# elif defined (USE_BZIP2_STATIC)
++# define BZIP2_DLL_IMPEXP
++# else /* assume USE_BZIP2_DLL */
++# define BZIP2_DLL_IMPEXP __DLL_IMPORT__
+ #endif
++#else /* __WIN32__ */
++# define BZIP2_DLL_IMPEXP
++#endif
++
++#define BZ_API(func) func
++#define BZ_EXTERN BZIP2_DLL_IMPEXP
+
+
+ /*-- Core (low-level) library functions --*/