]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix build on platforms without zlib.h. I need to dig out my old
authorTim Kientzle <kientzle@gmail.com>
Fri, 8 May 2009 17:32:08 +0000 (13:32 -0400)
committerTim Kientzle <kientzle@gmail.com>
Fri, 8 May 2009 17:32:08 +0000 (13:32 -0400)
CRC code and drop it in here to correctly break this dependency,
but these tests are so badly broken right now anyway...

SVN-Revision: 1074

libarchive/test/test_write_format_zip_no_compression.c

index e6633c78144d4d2b0dd5fee05cc39d85fe1cbfa3..cc2cb292f15cd15154defac91018bd6830b9d61c 100644 (file)
  */
 
 #include "test.h"
-#include <zlib.h>
 __FBSDID("$FreeBSD$");
 
+/* #include <zlib.h> */
+static unsigned long
+crc32(unsigned long c, void *p, size_t s)
+{
+       /* TODO: drop in a compact (but slow) bitwise CRC here to
+        * break the dependency on zlib.h; libarchive proper should be
+        * able to generate uncompressed zip archives correctly
+        * (including proper CRC even without zlib. */
+       (void)c;
+       (void)p;
+       (void)s;
+       return (0);
+}
+
+
 /* Quick and dirty: Read 2-byte and 4-byte integers from Zip file. */
 static int i2(const char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); }
 static int i4(const char *p) { return (i2(p) | (i2(p + 2) << 16)); }