]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
zlib.h: Use unsigned long for totals, for compatibility with zlib on 64-bit Windows
authorJosh Triplett <josh@joshtriplett.org>
Sun, 16 Aug 2020 17:39:24 +0000 (10:39 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 20 Aug 2020 10:05:55 +0000 (12:05 +0200)
Stock zlib uses unsigned long for total_in and total_out. On 64-bit
Windows, that isn't the same as size_t.

zlib.h

diff --git a/zlib.h b/zlib.h
index 3178571b385d4f345205eb9886fcd4ebd18a0bcd..3465878ded5c5f3b3c14c3e49c1161f41544d9b8 100644 (file)
--- a/zlib.h
+++ b/zlib.h
@@ -94,11 +94,11 @@ struct internal_state;
 typedef struct z_stream_s {
     const unsigned char   *next_in;   /* next input byte */
     uint32_t              avail_in;   /* number of bytes available at next_in */
-    size_t                total_in;   /* total number of input bytes read so far */
+    unsigned long         total_in;   /* total number of input bytes read so far */
 
     unsigned char         *next_out;  /* next output byte will go here */
     uint32_t              avail_out;  /* remaining free space at next_out */
-    size_t                total_out;  /* total number of bytes output so far */
+    unsigned long         total_out;  /* total number of bytes output so far */
 
     const char            *msg;       /* last error message, NULL if no error */
     struct internal_state *state;     /* not visible by applications */