summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2011-08-16 10:42:08 +0300
committerTor Lillqvist <tlillqvist@novell.com>2011-08-16 10:46:48 +0300
commitf3eea21424b27575defc9faff41958c4ed66ffb0 (patch)
treed13b21644da806e5d1fd89f8f406b84a38de3842
parentff7ee4a7fbc85b3bdd36bb18598b013204ab9b3a (diff)
Fix libgsf build with internal zlib that uses Z_PREFIX
-rw-r--r--libgsf/libgsf-1.14.19.patch52
-rw-r--r--libgsf/libgsf-1.14.19.windows.patch52
2 files changed, 104 insertions, 0 deletions
diff --git a/libgsf/libgsf-1.14.19.patch b/libgsf/libgsf-1.14.19.patch
index e8acba50c4c0..7afcdd834d04 100644
--- a/libgsf/libgsf-1.14.19.patch
+++ b/libgsf/libgsf-1.14.19.patch
@@ -36,3 +36,55 @@
_pkg_min_version=0.9.0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+--- misc/libgsf-1.14.19/gsf/gsf-infile-zip.c
++++ misc/build/libgsf-1.14.19/gsf/gsf-infile-zip.c
+@@ -30,6 +30,10 @@
+
+ #include <string.h>
+ #include <zlib.h>
++
++#if defined(Z_PREFIX) && defined(crc32)
++#undef crc32
++#endif
+
+ #undef G_LOG_DOMAIN
+ #define G_LOG_DOMAIN "libgsf:zip"
+
+--- misc/libgsf-1.14.19/gsf/gsf-outfile-zip.c
++++ misc/build/libgsf-1.14.19/gsf/gsf-outfile-zip.c
+@@ -29,6 +29,11 @@
+ #include <string.h>
+ #include <time.h>
+ #include <zlib.h>
++
++#if defined(Z_PREFIX) && defined(crc32)
++#define CRC32_WAS_DEFINED_AS_Z_CRC32
++#undef crc32
++#endif
+
+ #undef G_LOG_DOMAIN
+ #define G_LOG_DOMAIN "libgsf:zip"
+@@ -345,7 +345,11 @@
+ zip_header_write (zip);
+ zip->writing = TRUE;
+ zip->root->writing = TRUE;
++#if defined(CRC32_WAS_DEFINED_AS_Z_CRC32)
++ dirent->crc32 = z_crc32 (0L, Z_NULL, 0);
++#else
+ dirent->crc32 = crc32 (0L, Z_NULL, 0);
++#endif
+ if (zip->compression_method == GSF_ZIP_DEFLATED) {
+ if (!zip->stream) {
+ zip->stream = g_new0 (z_stream, 1);
+@@ -544,7 +544,11 @@
+ return FALSE;
+ dirent->csize += num_bytes;
+ }
++#if defined(CRC32_WAS_DEFINED_AS_Z_CRC32)
++ dirent->crc32 = z_crc32 (dirent->crc32, data, num_bytes);
++#else
+ dirent->crc32 = crc32 (dirent->crc32, data, num_bytes);
++#endif
+ dirent->usize += num_bytes;
+
+ return TRUE;
diff --git a/libgsf/libgsf-1.14.19.windows.patch b/libgsf/libgsf-1.14.19.windows.patch
index 2f4221420558..56c10c5d8c05 100644
--- a/libgsf/libgsf-1.14.19.windows.patch
+++ b/libgsf/libgsf-1.14.19.windows.patch
@@ -136,3 +136,55 @@
+$(MISC)$/$(SHL1TARGET).flt: makefile.mk
+ @echo CLEAR_THE_FILE > $@
+
+--- misc/libgsf-1.14.19/gsf/gsf-infile-zip.c
++++ misc/build/libgsf-1.14.19/gsf/gsf-infile-zip.c
+@@ -30,6 +30,10 @@
+
+ #include <string.h>
+ #include <zlib.h>
++
++#if defined(Z_PREFIX) && defined(crc32)
++#undef crc32
++#endif
+
+ #undef G_LOG_DOMAIN
+ #define G_LOG_DOMAIN "libgsf:zip"
+
+--- misc/libgsf-1.14.19/gsf/gsf-outfile-zip.c
++++ misc/build/libgsf-1.14.19/gsf/gsf-outfile-zip.c
+@@ -29,6 +29,11 @@
+ #include <string.h>
+ #include <time.h>
+ #include <zlib.h>
++
++#if defined(Z_PREFIX) && defined(crc32)
++#define CRC32_WAS_DEFINED_AS_Z_CRC32
++#undef crc32
++#endif
+
+ #undef G_LOG_DOMAIN
+ #define G_LOG_DOMAIN "libgsf:zip"
+@@ -345,7 +345,11 @@
+ zip_header_write (zip);
+ zip->writing = TRUE;
+ zip->root->writing = TRUE;
++#if defined(CRC32_WAS_DEFINED_AS_Z_CRC32)
++ dirent->crc32 = z_crc32 (0L, Z_NULL, 0);
++#else
+ dirent->crc32 = crc32 (0L, Z_NULL, 0);
++#endif
+ if (zip->compression_method == GSF_ZIP_DEFLATED) {
+ if (!zip->stream) {
+ zip->stream = g_new0 (z_stream, 1);
+@@ -544,7 +544,11 @@
+ return FALSE;
+ dirent->csize += num_bytes;
+ }
++#if defined(CRC32_WAS_DEFINED_AS_Z_CRC32)
++ dirent->crc32 = z_crc32 (dirent->crc32, data, num_bytes);
++#else
+ dirent->crc32 = crc32 (dirent->crc32, data, num_bytes);
++#endif
+ dirent->usize += num_bytes;
+
+ return TRUE;