aboutsummaryrefslogtreecommitdiff
path: root/zconf.h
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2012-04-29 16:18:12 -0700
committerMark Adler <madler@alumni.caltech.edu>2012-04-29 16:18:12 -0700
commit6c9bd474aa08312ef2e2e9655a80e18db24a1680 (patch)
tree2539e04a1037206dc3853fbdbb33194bb2690aaa /zconf.h
parent1be117908397b0ce065c07c60fa2b4ae778ff112 (diff)
downloadzlib-6c9bd474aa08312ef2e2e9655a80e18db24a1680.tar.gz
zlib-6c9bd474aa08312ef2e2e9655a80e18db24a1680.tar.bz2
zlib-6c9bd474aa08312ef2e2e9655a80e18db24a1680.zip
Fix type mismatch between get_crc_table() and crc_table.
crc_table is made using a four-byte integer (when that can be determined). However get_crc_table() returned a pointer to an unsigned long, which could be eight bytes. This fixes that by creating a new z_crc_t type for the crc_table. This type is also used for the BYFOUR crc calculations that depend on a four-byte type. The four-byte type can now be determined by ./configure, which also solves a problem where ./configure --solo would never use BYFOUR. No the Z_U4 #define indicates that four- byte integer was found either by ./configure or by zconf.h.
Diffstat (limited to 'zconf.h')
-rw-r--r--zconf.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/zconf.h b/zconf.h
index 8c6f945..8a46a58 100644
--- a/zconf.h
+++ b/zconf.h
@@ -388,6 +388,29 @@ typedef uLong FAR uLongf;
388 typedef Byte *voidp; 388 typedef Byte *voidp;
389#endif 389#endif
390 390
391/* ./configure may #define Z_U4 here */
392
393#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
394# include <limits.h>
395# if (UINT_MAX == 0xffffffffUL)
396# define Z_U4 unsigned
397# else
398# if (ULONG_MAX == 0xffffffffUL)
399# define Z_U4 unsigned long
400# else
401# if (USHRT_MAX == 0xffffffffUL)
402# define Z_U4 unsigned short
403# endif
404# endif
405# endif
406#endif
407
408#ifdef Z_U4
409 typedef Z_U4 z_crc_t;
410#else
411 typedef unsigned long z_crc_t;
412#endif
413
391#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ 414#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
392# define Z_HAVE_UNISTD_H 415# define Z_HAVE_UNISTD_H
393#endif 416#endif