1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

zlibWrapper: Update for zlib 1.2.12 (#3217)

In zlib 1.2.12 the OF macro was changed to _Z_OF breaking any
project that used zlibWrapper. To fix this the OF has been
changed to _Z_OF everywhere and _Z_OF is defined as OF in the
case it is not yet defined for zlib 1.2.11 and older.

Fixes: https://github.com/facebook/zstd/issues/3216
This commit is contained in:
orbea
2022-07-29 12:22:10 -07:00
committed by GitHub
parent b1bbb0eb4c
commit 1e09cffd9b
10 changed files with 118 additions and 115 deletions

View File

@ -56,26 +56,26 @@ z_const char hello[] = "hello, hello! I said hello, hello!";
const char dictionary[] = "hello, hello!";
uLong dictId; /* Adler32 value of the dictionary */
void test_deflate OF((Byte *compr, uLong comprLen));
void test_inflate OF((Byte *compr, uLong comprLen,
void test_deflate _Z_OF((Byte *compr, uLong comprLen));
void test_inflate _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_large_deflate OF((Byte *compr, uLong comprLen,
void test_large_deflate _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_large_inflate OF((Byte *compr, uLong comprLen,
void test_large_inflate _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_flush OF((Byte *compr, uLong *comprLen));
void test_sync OF((Byte *compr, uLong comprLen,
void test_flush _Z_OF((Byte *compr, uLong *comprLen));
void test_sync _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_dict_deflate OF((Byte *compr, uLong comprLen));
void test_dict_inflate OF((Byte *compr, uLong comprLen,
void test_dict_deflate _Z_OF((Byte *compr, uLong comprLen));
void test_dict_inflate _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
int main OF((int argc, char *argv[]));
int main _Z_OF((int argc, char *argv[]));
#ifdef Z_SOLO
void *myalloc OF((void *, unsigned, unsigned));
void myfree OF((void *, void *));
void *myalloc _Z_OF((void *, unsigned, unsigned));
void myfree _Z_OF((void *, void *));
void *myalloc(q, n, m)
void *q;
@ -102,9 +102,9 @@ static free_func zfree = myfree;
static alloc_func zalloc = (alloc_func)0;
static free_func zfree = (free_func)0;
void test_compress OF((Byte *compr, uLong comprLen,
void test_compress _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_gzio OF((const char *fname,
void test_gzio _Z_OF((const char *fname,
Byte *uncompr, uLong uncomprLen));
/* ===========================================================================

View File

@ -51,26 +51,26 @@ z_const char hello[] = "hello, hello!";
const char dictionary[] = "hello";
uLong dictId; /* Adler32 value of the dictionary */
void test_deflate OF((Byte *compr, uLong comprLen));
void test_inflate OF((Byte *compr, uLong comprLen,
void test_deflate _Z_OF((Byte *compr, uLong comprLen));
void test_inflate _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_large_deflate OF((Byte *compr, uLong comprLen,
void test_large_deflate _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_large_inflate OF((Byte *compr, uLong comprLen,
void test_large_inflate _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_flush OF((Byte *compr, uLong *comprLen));
void test_sync OF((Byte *compr, uLong comprLen,
void test_flush _Z_OF((Byte *compr, uLong *comprLen));
void test_sync _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_dict_deflate OF((Byte *compr, uLong comprLen));
void test_dict_inflate OF((Byte *compr, uLong comprLen,
void test_dict_deflate _Z_OF((Byte *compr, uLong comprLen));
void test_dict_inflate _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
int main OF((int argc, char *argv[]));
int main _Z_OF((int argc, char *argv[]));
#ifdef Z_SOLO
void *myalloc OF((void *, unsigned, unsigned));
void myfree OF((void *, void *));
void *myalloc _Z_OF((void *, unsigned, unsigned));
void myfree _Z_OF((void *, void *));
void *myalloc(q, n, m)
void *q;
@ -94,9 +94,9 @@ static free_func zfree = myfree;
static alloc_func zalloc = (alloc_func)0;
static free_func zfree = (free_func)0;
void test_compress OF((Byte *compr, uLong comprLen,
void test_compress _Z_OF((Byte *compr, uLong comprLen,
Byte *uncompr, uLong uncomprLen));
void test_gzio OF((const char *fname,
void test_gzio _Z_OF((const char *fname,
Byte *uncompr, uLong uncomprLen));
/* ===========================================================================

View File

@ -64,7 +64,7 @@
#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE)
#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
extern int unlink OF((const char *));
extern int unlink _Z_OF((const char *));
#endif
#endif
@ -154,8 +154,8 @@ static void pwinerror (s)
# include <unistd.h> /* for unlink() */
#endif
void *myalloc OF((void *, unsigned, unsigned));
void myfree OF((void *, void *));
void *myalloc _Z_OF((void *, unsigned, unsigned));
void myfree _Z_OF((void *, void *));
void *myalloc(q, n, m)
void *q;
@ -180,9 +180,9 @@ typedef struct gzFile_s {
z_stream strm;
} *gzFile;
gzFile gzopen OF((const char *, const char *));
gzFile gzdopen OF((int, const char *));
gzFile gz_open OF((const char *, int, const char *));
gzFile gzopen _Z_OF((const char *, const char *));
gzFile gzdopen _Z_OF((int, const char *));
gzFile gz_open _Z_OF((const char *, int, const char *));
gzFile gzopen(path, mode)
const char *path;
@ -236,7 +236,7 @@ gzFile gz_open(path, fd, mode)
return gz;
}
int gzwrite OF((gzFile, const void *, unsigned));
int gzwrite _Z_OF((gzFile, const void *, unsigned));
int gzwrite(gz, buf, len)
gzFile gz;
@ -260,7 +260,7 @@ int gzwrite(gz, buf, len)
return len;
}
int gzread OF((gzFile, void *, unsigned));
int gzread _Z_OF((gzFile, void *, unsigned));
int gzread(gz, buf, len)
gzFile gz;
@ -297,7 +297,7 @@ int gzread(gz, buf, len)
return len - strm->avail_out;
}
int gzclose OF((gzFile));
int gzclose _Z_OF((gzFile));
int gzclose(gz)
gzFile gz;
@ -326,7 +326,7 @@ int gzclose(gz)
return Z_OK;
}
const char *gzerror OF((gzFile, int *));
const char *gzerror _Z_OF((gzFile, int *));
const char *gzerror(gz, err)
gzFile gz;
@ -340,15 +340,15 @@ const char *gzerror(gz, err)
char *prog;
void error OF((const char *msg));
void gz_compress OF((FILE *in, gzFile out));
void error _Z_OF((const char *msg));
void gz_compress _Z_OF((FILE *in, gzFile out));
#ifdef USE_MMAP
int gz_compress_mmap OF((FILE *in, gzFile out));
int gz_compress_mmap _Z_OF((FILE *in, gzFile out));
#endif
void gz_uncompress OF((gzFile in, FILE *out));
void file_compress OF((char *file, char *mode));
void file_uncompress OF((char *file));
int main OF((int argc, char *argv[]));
void gz_uncompress _Z_OF((gzFile in, FILE *out));
void file_compress _Z_OF((char *file, char *mode));
void file_uncompress _Z_OF((char *file));
int main _Z_OF((int argc, char *argv[]));
/* ===========================================================================
* Display error message and exit