aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2012-02-01 23:47:47 -0800
committerMark Adler <madler@alumni.caltech.edu>2012-02-01 23:55:29 -0800
commitf9e4edc99629ae10e3cfd7091a4742e4e4e2dbec (patch)
tree096cbe47ab33ee0303add997657f8d891eef9210
parent55b8b5fec16503cb9ce26074f600a1d7b426a0cc (diff)
downloadzlib-f9e4edc99629ae10e3cfd7091a4742e4e4e2dbec.tar.gz
zlib-f9e4edc99629ae10e3cfd7091a4742e4e4e2dbec.tar.bz2
zlib-f9e4edc99629ae10e3cfd7091a4742e4e4e2dbec.zip
Avoid library header include in crc32.c for Z_SOLO.
crc32.c was #including limits.h in order to find a four-byte integer type. It was doing this even if Z_SOLO were defined, violating the intent of Z_SOLO, which is to include no library headers and require no library functions. Now crc32.c obeys the intent of Z_SOLO, but with the downside that crc32() will be slower than when not compiled with Z_SOLO. This can be remedied manually by typedefing u4 to a known four-byte unsigned integer type, and #defining BYFOUR in crc32.c.
-rw-r--r--crc32.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crc32.c b/crc32.c
index c12471e..ddf0025 100644
--- a/crc32.c
+++ b/crc32.c
@@ -33,6 +33,9 @@
33#define local static 33#define local static
34 34
35/* Find a four-byte integer type for crc32_little() and crc32_big(). */ 35/* Find a four-byte integer type for crc32_little() and crc32_big(). */
36#ifdef Z_SOLO
37# define NOBYFOUR
38#endif
36#ifndef NOBYFOUR 39#ifndef NOBYFOUR
37# ifdef STDC /* need ANSI C limits.h to determine sizes */ 40# ifdef STDC /* need ANSI C limits.h to determine sizes */
38# include <limits.h> 41# include <limits.h>