From e01b3f7aaeb5a36d03c0dfe294197cad2518478d Mon Sep 17 00:00:00 2001 From: Martin Lambers Date: Wed, 30 Jan 2013 18:10:28 +0100 Subject: package bzip2: fix runtime crashes This moves the source modifications from the Makefile into a patch, and it adds a critical change: instead of removing WINAPI, the whole _WIN32 preprocessor block is deactivated. This fixes the BZ_API macro. This is necessary to fix runtime crashes in my application. --- src/bzip2-1-fixes.patch | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ src/bzip2.mk | 2 -- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 src/bzip2-1-fixes.patch diff --git a/src/bzip2-1-fixes.patch b/src/bzip2-1-fixes.patch new file mode 100644 index 0000000..250df6e --- /dev/null +++ b/src/bzip2-1-fixes.patch @@ -0,0 +1,54 @@ +This file is part of MXE. +See index.html for further information. + +diff -uNr bzip2-1.0.6.orig/bzip2.c bzip2-1.0.6/bzip2.c +--- bzip2-1.0.6.orig/bzip2.c 2010-09-11 01:04:53.000000000 +0200 ++++ bzip2-1.0.6/bzip2.c 2013-01-30 16:24:00.170396872 +0100 +@@ -128,7 +128,7 @@ + #if BZ_LCCWIN32 + # include + # include +-# include ++# include + + # define NORETURN /**/ + # define PATH_SEP '\\' +diff -uNr bzip2-1.0.6.orig/bzlib.h bzip2-1.0.6/bzlib.h +--- bzip2-1.0.6.orig/bzlib.h 2010-09-11 01:08:42.000000000 +0200 ++++ bzip2-1.0.6/bzlib.h 2013-01-30 16:22:10.514401460 +0100 +@@ -75,7 +75,7 @@ + #include + #endif + +-#ifdef _WIN32 ++#if 0 + # include + # ifdef small + /* windows.h define small to char */ +@@ -116,7 +116,7 @@ + BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( + bz_stream *strm, + int verbosity, +- int small ++ int small_ + ); + + BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( +@@ -140,7 +140,7 @@ + int* bzerror, + FILE* f, + int verbosity, +- int small, ++ int small_, + void* unused, + int nUnused + ); +@@ -216,7 +216,7 @@ + unsigned int* destLen, + char* source, + unsigned int sourceLen, +- int small, ++ int small_, + int verbosity + ); + diff --git a/src/bzip2.mk b/src/bzip2.mk index fa2d073..fe3e859 100644 --- a/src/bzip2.mk +++ b/src/bzip2.mk @@ -17,8 +17,6 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD - $(SED) -i 's,sys\\stat\.h,sys/stat.h,g' '$(1)/bzip2.c' - $(SED) -i 's,WINAPI,,g' '$(1)/bzlib.h' $(MAKE) -C '$(1)' -j '$(JOBS)' libbz2.a \ PREFIX='$(PREFIX)/$(TARGET)' \ CC='$(TARGET)-gcc' \ -- cgit v0.12