compiling git with ZLIB < 1.2

From: Andreas Gal <gal@uci.edu>
Date: 2005-04-23 08:12:06
deflateBound() was added in ZLIB 1.2, but there is unfortunately no easy 
way to check against the ZLIB version. I would suggest to use the fix 
below until everyone has a recent ZLIB installed (neither my RHEL3 nor my 
Darwin box does by default).

Andreas

--- a/sha1_file.c
+++ b/sha1_file.c
@@ -240,7 +240,11 @@ int write_sha1_file(char *buf, unsigned 
 	/* Set it up */
 	memset(&stream, 0, sizeof(stream));
 	deflateInit(&stream, Z_BEST_COMPRESSION);
+#ifdef ONCE_EVERYONE_UPDATED_TO_ZLIB_12
 	size = deflateBound(&stream, len);
+#else	
+	size = len + ((len + 7) >> 3) + ((len + 63) >> 6) + 11;
+#endif	
 	compressed = malloc(size);
 
 	/* Compress it */
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Apr 23 08:13:39 2005

This archive was generated by hypermail 2.1.8 : 2005-04-23 08:13:40 EST