aboutsummaryrefslogtreecommitdiff
path: root/gzlib.c
diff options
context:
space:
mode:
authorMilan Bulat <milan@peer.inc>2023-10-09 17:04:51 +0400
committerMark Adler <madler@alumni.caltech.edu>2024-01-17 16:07:14 -0800
commit01253ecd7e0a01d311670f2d03c61b82fc12d338 (patch)
tree0f50fa36e7b5426cc5f31925c31ae14696edd959 /gzlib.c
parent6201f893846bfd22faf060e84a3bb7bfc0e61761 (diff)
downloadzlib-01253ecd7e0a01d311670f2d03c61b82fc12d338.tar.gz
zlib-01253ecd7e0a01d311670f2d03c61b82fc12d338.tar.bz2
zlib-01253ecd7e0a01d311670f2d03c61b82fc12d338.zip
Make the existence of gz_intmax() unconditional.
gz_intmax() is noted in zlib.map. This assures it's always there.
Diffstat (limited to 'gzlib.c')
-rw-r--r--gzlib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gzlib.c b/gzlib.c
index 29fc448..9c103db 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -563,20 +563,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
563#endif 563#endif
564} 564}
565 565
566#ifndef INT_MAX
567/* portably return maximum value for an int (when limits.h presumed not 566/* portably return maximum value for an int (when limits.h presumed not
568 available) -- we need to do this to cover cases where 2's complement not 567 available) -- we need to do this to cover cases where 2's complement not
569 used, since C standard permits 1's complement and sign-bit representations, 568 used, since C standard permits 1's complement and sign-bit representations,
570 otherwise we could just use ((unsigned)-1) >> 1 */ 569 otherwise we could just use ((unsigned)-1) >> 1 */
571unsigned ZLIB_INTERNAL gz_intmax(void) { 570unsigned ZLIB_INTERNAL gz_intmax(void) {
572 unsigned p, q; 571#ifdef INT_MAX
573 572 return INT_MAX;
574 p = 1; 573#else
574 unsigned p = 1, q;
575 do { 575 do {
576 q = p; 576 q = p;
577 p <<= 1; 577 p <<= 1;
578 p++; 578 p++;
579 } while (p > q); 579 } while (p > q);
580 return q >> 1; 580 return q >> 1;
581}
582#endif 581#endif
582}