aboutsummaryrefslogtreecommitdiff
path: root/zconf.h.cmakein
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.cmakein
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.cmakein')
-rw-r--r--zconf.h.cmakein23
1 files changed, 23 insertions, 0 deletions
diff --git a/zconf.h.cmakein b/zconf.h.cmakein
index 4ade487..b6ca59a 100644
--- a/zconf.h.cmakein
+++ b/zconf.h.cmakein
@@ -390,6 +390,29 @@ typedef uLong FAR uLongf;
390 typedef Byte *voidp; 390 typedef Byte *voidp;
391#endif 391#endif
392 392
393/* ./configure may #define Z_U4 here */
394
395#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
396# include <limits.h>
397# if (UINT_MAX == 0xffffffffUL)
398# define Z_U4 unsigned
399# else
400# if (ULONG_MAX == 0xffffffffUL)
401# define Z_U4 unsigned long
402# else
403# if (USHRT_MAX == 0xffffffffUL)
404# define Z_U4 unsigned short
405# endif
406# endif
407# endif
408#endif
409
410#ifdef Z_U4
411 typedef Z_U4 z_crc_t;
412#else
413 typedef unsigned long z_crc_t;
414#endif
415
393#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ 416#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
394# define Z_HAVE_UNISTD_H 417# define Z_HAVE_UNISTD_H
395#endif 418#endif