]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix ZLIB_COMPAT=OFF and WITH_GZFILEOP=ON compilation failure.
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Mon, 17 Sep 2018 10:22:43 +0000 (12:22 +0200)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Mon, 17 Sep 2018 10:22:43 +0000 (12:22 +0200)
Also add this combination to travis testing.

Remove --native testing from travis, since they somehow make this fail very often,
probably due to caching or running the executables on a different platform than
the compiler thinks it is running on.

.travis.yml
gzguts.h
gzread.c
gzwrite.c
zlib-ng.h

index 84531641d51ac5c3ed4b10d752ad33dee017e7d4..3b6933bd9f29b782f09fa67f592e824d4a553923 100644 (file)
@@ -9,7 +9,7 @@ matrix:
       env: BUILDDIR=. TOOL="./configure --warn"
     - os: linux
       compiler: gcc
-      env: BUILDDIR=. TOOL="./configure --warn --zlib-compat --native"
+      env: BUILDDIR=. TOOL="cmake . -DZLIB_COMPAT=OFF -DWITH_GZFILEOP=ON -DWITH_NEW_STRATEGIES=YES -DWITH_OPTIM=ON"
     - os: linux
       compiler: gcc
       env: BUILDDIR=../build TOOL="../zlib-ng/configure --warn --zlib-compat"
index 2e7e7813cfb783255616dd3f2be9e0dbd9f3e929..6e84adb7df103f7252aa69090047ce5f9d3e82cf 100644 (file)
--- a/gzguts.h
+++ b/gzguts.h
@@ -138,7 +138,7 @@ typedef struct {
     int err;                /* error code */
     char *msg;              /* error message */
         /* zlib inflate or deflate stream */
-    z_stream strm;          /* stream structure in-place (not a pointer) */
+    PREFIX3(stream) strm;  /* stream structure in-place (not a pointer) */
 } gz_state;
 typedef gz_state *gz_statep;
 
index dc4f50f820228c5910e6dd4aebd1879a0c2b5969..4b72875f1946d28467de3ba7db9c568e836b2c18 100644 (file)
--- a/gzread.c
+++ b/gzread.c
@@ -47,7 +47,7 @@ static int gz_load(gz_state *state, unsigned char *buf, unsigned len, unsigned *
    available data from the input file. */
 static int gz_avail(gz_state *state) {
     unsigned got;
-    z_stream *strm = &(state->strm);
+    PREFIX3(stream) *strm = &(state->strm);
 
     if (state->err != Z_OK && state->err != Z_BUF_ERROR)
         return -1;
@@ -78,7 +78,7 @@ static int gz_avail(gz_state *state) {
    a user buffer.  If decompressing, the inflate state will be initialized.
    gz_look() will return 0 on success or -1 on failure. */
 static int gz_look(gz_state *state) {
-    z_stream *strm = &(state->strm);
+    PREFIX3(stream) *strm = &(state->strm);
 
     /* allocate read buffers and inflate memory */
     if (state->size == 0) {
@@ -162,7 +162,7 @@ static int gz_look(gz_state *state) {
 static int gz_decomp(gz_state *state) {
     int ret = Z_OK;
     unsigned had;
-    z_stream *strm = &(state->strm);
+    PREFIX3(stream) *strm = &(state->strm);
 
     /* fill output buffer up to end of deflate stream */
     had = strm->avail_out;
@@ -210,7 +210,7 @@ static int gz_decomp(gz_state *state) {
    otherwise 0.  gz_fetch() will leave state->how as COPY or GZIP unless the
    end of the input file has been reached and all data has been processed.  */
 static int gz_fetch(gz_state *state) {
-    z_stream *strm = &(state->strm);
+    PREFIX3(stream) *strm = &(state->strm);
 
     do {
         switch (state->how) {
@@ -406,6 +406,7 @@ size_t ZEXPORT PREFIX(gzfread)(void *buf, size_t size, size_t nitems, gzFile fil
 
 /* -- see zlib.h -- */
 #undef gzgetc
+#undef zng_gzgetc
 int ZEXPORT PREFIX(gzgetc)(gzFile file) {
     int ret;
     unsigned char buf[1];
index 0476d9a07d1641a743d0171c767f0dd7eae78212..8395b65eb8e5db15f7a4149e91e609fe1b012aca 100644 (file)
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -18,7 +18,7 @@ static size_t gz_write(gz_state *, void const *, size_t);
    success. */
 static int gz_init(gz_state *state) {
     int ret;
-    z_stream *strm = &(state->strm);
+    PREFIX3(stream) *strm = &(state->strm);
 
     /* allocate input buffer (double size for gzprintf) */
     state->in = (unsigned char *)malloc(state->want << 1);
@@ -73,7 +73,7 @@ static int gz_comp(gz_state *state, int flush) {
     int ret;
     ssize_t got;
     unsigned have;
-    z_stream *strm = &(state->strm);
+    PREFIX3(stream) *strm = &(state->strm);
 
     /* allocate memory if this is the first time through */
     if (state->size == 0 && gz_init(state) == -1)
@@ -132,7 +132,7 @@ static int gz_comp(gz_state *state, int flush) {
 static int gz_zero(gz_state *state, z_off64_t len) {
     int first;
     unsigned n;
-    z_stream *strm = &(state->strm);
+    PREFIX3(stream) *strm = &(state->strm);
 
     /* consume whatever's left in the input buffer */
     if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
@@ -278,7 +278,7 @@ int ZEXPORT PREFIX(gzputc)(gzFile file, int c) {
     unsigned have;
     unsigned char buf[1];
     gz_state *state;
-    z_stream *strm;
+    PREFIX3(stream) *strm;
 
     /* get internal structure */
     if (file == NULL)
@@ -345,7 +345,7 @@ int ZEXPORTVA PREFIX(gzvprintf)(gzFile file, const char *format, va_list va) {
     unsigned left;
     char *next;
     gz_state *state;
-    z_stream *strm;
+    PREFIX3(stream) *strm;
 
     /* get internal structure */
     if (file == NULL)
@@ -438,7 +438,7 @@ int ZEXPORT PREFIX(gzflush)(gzFile file, int flush) {
 /* -- see zlib.h -- */
 int ZEXPORT PREFIX(gzsetparams)(gzFile file, int level, int strategy) {
     gz_state *state;
-    z_stream *strm;
+    PREFIX3(stream) *strm;
 
     /* get internal structure */
     if (file == NULL)
index a2e59deeb40744a5d440598de0e22cf4ac0b253c..6010bba983f338d28367e938ebf96f72b892c28a 100644 (file)
--- a/zlib-ng.h
+++ b/zlib-ng.h
@@ -1754,10 +1754,10 @@ ZEXTERN int ZEXPORT zng_gzgetc_(gzFile file);  /* backward compatibility */
 #endif
 
 #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
-#    define gzopen gzopen64
-#    define gzseek gzseek64
-#    define gztell gztell64
-#    define gzoffset gzoffset64
+#    define zng_gzopen zng_gzopen64
+#    define zng_gzseek zng_gzseek64
+#    define zng_gztell zng_gztell64
+#    define zng_gzoffset zng_gzoffset64
 #  ifndef Z_LARGE64
      ZEXTERN gzFile ZEXPORT zng_gzopen64(const char *, const char *);
      ZEXTERN z_off_t ZEXPORT zng_gzseek64(gzFile, z_off_t, int);