diff -ur zconf.h.orig zconf.h
--- zconf.h.orig	2023-11-13 15:40:04.747701100 -0500
+++ zconf.h	2023-11-13 15:32:42.779176600 -0500
@@ -9,6 +9,8 @@
 #define ZCONF_H
 #include <stdint.h>
 
+#define Z_PREFIX
+
 /*
  * If you *really* need a unique prefix for all types and library functions,
  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
@@ -30,6 +32,7 @@
 #  define adler32               z_adler32
 #  define adler32_combine       z_adler32_combine
 #  define adler32_combine64     z_adler32_combine64
+#  define adler32_z             z_adler32_z
 #  ifndef Z_SOLO
 #    define compress              z_compress
 #    define compress2             z_compress2
@@ -111,6 +114,7 @@
 #  define inflateSyncPoint      z_inflateSyncPoint
 #  define inflateUndermine      z_inflateUndermine
 #  define inflateResetKeep      z_inflateResetKeep
+#  define inflateValidate       z_inflateValidate
 #  define inflate_copyright     z_inflate_copyright
 #  define inflate_fast          z_inflate_fast
 #  define inflate_table         z_inflate_table


================================================================================
diff -ur gzguts.h.orig gzguts.h
--- gzguts.h.orig       2023-11-27 10:02:01.338347000 -0500
+++ gzguts.h    2023-11-28 09:34:08.212815700 -0500
@@ -3,6 +3,10 @@
  * For conditions of distribution and use, see copyright notice in zlib.h
  */

+#ifndef _WIN32
+#  include <unistd.h>
+#endif
+
 #ifdef _LARGEFILE64_SOURCE
 #  ifndef _LARGEFILE_SOURCE
 #    define _LARGEFILE_SOURCE 1


================================================================================
diff -ur crc32.c.orig crc32.c
--- crc32.c.orig	2024-03-19 09:38:09.492184800 -0400
+++ crc32.c	2024-03-19 10:17:33.177199400 -0400
@@ -20,6 +20,8 @@
   produced, so that this one source file can be compiled to an executable.
  */
 
+#include "zutil_cf.h"
+
 #ifdef HAS_PCLMUL
  #include "crc32_simd.h"
  #ifndef _MSC_VER
@@ -34,7 +36,7 @@
 #include <stdint.h>
 #include <stddef.h>
 
-uint32_t crc32(uint32_t crc, uint8_t *buf, size_t len) {
+uint32_t crc32_orig(uint32_t crc, const Bytef *buf, uInt len) {
     crc = ~crc;
 
     while (len >= 8) {
@@ -58,6 +60,11 @@
     return ~crc;
 }
 
+uLong crc32(uLong crc, const Bytef *buf, uInt len) {
+    return crc32_orig(crc, buf, len);
+}
+
+
 #else
 
 #ifdef MAKECRCH
@@ -67,8 +74,6 @@
 #  endif /* !DYNAMIC_CRC_TABLE */
 #endif /* MAKECRCH */
 
-#include "zutil.h"      /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */
-
 #define local static
 
 /* Definitions for doing the crc four data bytes at a time. */

================================================================================

