From 76df52818ad91d857a6c7551ac7737000a0f7770 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 5 Sep 2025 19:59:12 -0700 Subject: [PATCH] zlib: hack for portability... zlib/zconf.h is ... "special". Signed-off-by: H. Peter Anvin (Intel) --- zlib/adler32.c | 4 ++++ zlib/crc32.c | 2 ++ zlib/zconf.h | 10 ++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/zlib/adler32.c b/zlib/adler32.c index 04b81d29..7312c0c1 100644 --- a/zlib/adler32.c +++ b/zlib/adler32.c @@ -159,6 +159,10 @@ uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) { return adler32_combine_(adler1, adler2, len2); } +#if 0 /* NASM hack */ + uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) { return adler32_combine_(adler1, adler2, len2); } + +#endif diff --git a/zlib/crc32.c b/zlib/crc32.c index 6c38f5c0..9d8592a9 100644 --- a/zlib/crc32.c +++ b/zlib/crc32.c @@ -1018,6 +1018,7 @@ unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, } /* ========================================================================= */ +static /* NASM hack */ uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); @@ -1031,6 +1032,7 @@ uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) { } /* ========================================================================= */ +static /* NASM hack */ uLong ZEXPORT crc32_combine_gen64(z_off64_t len2) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); diff --git a/zlib/zconf.h b/zlib/zconf.h index 9512daa1..7490ced8 100644 --- a/zlib/zconf.h +++ b/zlib/zconf.h @@ -12,6 +12,8 @@ #define HAVE_VSNPRINTF 1 /* If it doesn't exist we add it */ #define Z_SOLO 1 +#define z_off_t off_t +#define z_off64_t off_t /* * If you *really* need a unique prefix for all types and library functions, @@ -438,6 +440,8 @@ typedef uLong FAR uLongf; typedef unsigned long z_crc_t; #endif +#if 0 /* NASM hack: this breaks stuff */ + #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif @@ -501,11 +505,11 @@ typedef uLong FAR uLongf; #endif #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) -# define Z_LARGE64 + # define Z_LARGE64 #endif #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) -# define Z_WANT64 + # define Z_WANT64 #endif #if !defined(SEEK_SET) && !defined(Z_SOLO) @@ -528,6 +532,8 @@ typedef uLong FAR uLongf; # endif #endif +#endif /* NASM hack */ + /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) #pragma map(deflateInit_,"DEIN")