From: Tim Kientzle Date: Fri, 8 May 2009 17:32:08 +0000 (-0400) Subject: Fix build on platforms without zlib.h. I need to dig out my old X-Git-Tag: v2.8.0~659 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b81d28d851e3f024f6d1bed7ee7c39db5ffe762;p=thirdparty%2Flibarchive.git Fix build on platforms without zlib.h. I need to dig out my old 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 --- diff --git a/libarchive/test/test_write_format_zip_no_compression.c b/libarchive/test/test_write_format_zip_no_compression.c index e6633c781..cc2cb292f 100644 --- a/libarchive/test/test_write_format_zip_no_compression.c +++ b/libarchive/test/test_write_format_zip_no_compression.c @@ -28,9 +28,23 @@ */ #include "test.h" -#include __FBSDID("$FreeBSD$"); +/* #include */ +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)); }