]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed extra symbols added to ABI when zlib-compat specified.
authorNathan Moinvaziri <nathan@solidstatenetworks.com>
Sun, 5 Jul 2020 18:13:20 +0000 (11:13 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 2 Aug 2020 16:32:25 +0000 (18:32 +0200)
14 files changed:
adler32.c
arch/power/power.c
arch/x86/adler32_avx.c
arch/x86/adler32_ssse3.c
arch/x86/compare258_avx.c
arch/x86/compare258_sse.c
chunkset_tpl.h
compare258.c
deflate.c
inftrees.c
match_tpl.h
zlib.map
zutil.c
zutil.h

index 4685c76f14e2586ac3a86a34e78a16fe6f6bedea..247c45be3c1ac0ad5695a703f95ac24a35cb39b0 100644 (file)
--- a/adler32.c
+++ b/adler32.c
@@ -8,11 +8,8 @@
 #include "functable.h"
 #include "adler32_p.h"
 
-uint32_t adler32_c(uint32_t adler, const unsigned char *buf, size_t len);
-static uint32_t adler32_combine_(uint32_t adler1, uint32_t adler2, z_off64_t len2);
-
 /* ========================================================================= */
-uint32_t adler32_c(uint32_t adler, const unsigned char *buf, size_t len) {
+ZLIB_INTERNAL uint32_t adler32_c(uint32_t adler, const unsigned char *buf, size_t len) {
     uint32_t sum2;
     unsigned n;
 
index 8f0c49c09b8da2c3767dd60988d2bd547f286c81..200fe453c62ff09af4752f3649ece935db7df1c0 100644 (file)
@@ -4,7 +4,7 @@
  */
 
 #include <sys/auxv.h>
-#include "zutil.h"
+#include "../../zutil.h"
 
 ZLIB_INTERNAL int power_cpu_has_arch_2_07;
 
index 75d5ae32b573bc47e9c7bf12d4d7ac0ec3e2acf6..3745fcb24ee41c305c2b881304e874dd81541968 100644 (file)
@@ -17,7 +17,7 @@
 
 #ifdef X86_AVX2_ADLER32
 
-uint32_t adler32_avx2(uint32_t adler, const unsigned char *buf, size_t len) {
+ZLIB_INTERNAL uint32_t adler32_avx2(uint32_t adler, const unsigned char *buf, size_t len) {
     uint32_t sum2;
 
      /* split Adler-32 into component sums */
index 7d3eef5fd0cbd0888a74578eab56f51948937257..b60ec68a11551c7a5abea8f45ba5dc2b8a88cc5c 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <immintrin.h>
 
-uint32_t adler32_ssse3(uint32_t adler, const unsigned char *buf, size_t len) {
+ZLIB_INTERNAL uint32_t adler32_ssse3(uint32_t adler, const unsigned char *buf, size_t len) {
     uint32_t sum2;
 
      /* split Adler-32 into component sums */
index fe38d16c9e6dd3b540249896a5480740c412d722..ef5fa8cec8cd84b8c862af5e3ed82db6337be6c4 100644 (file)
@@ -54,7 +54,7 @@ static inline int32_t compare258_unaligned_avx2_static(const unsigned char *src0
     return compare256_unaligned_avx2_static(src0+2, src1+2) + 2;
 }
 
-int32_t compare258_unaligned_avx2(const unsigned char *src0, const unsigned char *src1) {
+ZLIB_INTERNAL int32_t compare258_unaligned_avx2(const unsigned char *src0, const unsigned char *src1) {
     return compare258_unaligned_avx2_static(src0, src1);
 }
 
index 2c274823fc26c19e2498451675543f1f426c46d7..1cf7b0fb0bf127d033ba355c94646f8ee4284e17 100644 (file)
@@ -61,7 +61,7 @@ static inline int32_t compare258_unaligned_sse4_static(const unsigned char *src0
     return compare256_unaligned_sse4_static(src0+2, src1+2) + 2;
 }
 
-int32_t compare258_unaligned_sse4(const unsigned char *src0, const unsigned char *src1) {
+ZLIB_INTERNAL int32_t compare258_unaligned_sse4(const unsigned char *src0, const unsigned char *src1) {
     return compare258_unaligned_sse4_static(src0, src1);
 }
 
index 60b2db2934fc9937941ba5d3ec901bb045ab8065..4abf1941319ba20d8a6f651c83bd87886390190e 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 /* Returns the chunk size */
-uint32_t CHUNKSIZE(void) {
+ZLIB_INTERNAL uint32_t CHUNKSIZE(void) {
     return sizeof(chunk_t);
 }
 
@@ -17,7 +17,7 @@ uint32_t CHUNKSIZE(void) {
    (chunk_t bytes or fewer) will fall straight through the loop
    without iteration, which will hopefully make the branch prediction more
    reliable. */
-uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
+ZLIB_INTERNAL uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
     chunk_t chunk;
     --len;
     loadchunk(from, &chunk);
@@ -36,7 +36,7 @@ uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
 }
 
 /* Behave like chunkcopy, but avoid writing beyond of legal output. */
-uint8_t* CHUNKCOPY_SAFE(uint8_t *out, uint8_t const *from, unsigned len, uint8_t *safe) {
+ZLIB_INTERNAL uint8_t* CHUNKCOPY_SAFE(uint8_t *out, uint8_t const *from, unsigned len, uint8_t *safe) {
     if ((safe - out) < (ptrdiff_t)sizeof(chunk_t)) {
         if (len & 8) {
             memcpy(out, from, 8);
@@ -69,7 +69,7 @@ uint8_t* CHUNKCOPY_SAFE(uint8_t *out, uint8_t const *from, unsigned len, uint8_t
    This assumption holds because inflate_fast() starts every iteration with at
    least 258 bytes of output space available (258 being the maximum length
    output from a single token; see inflate_fast()'s assumptions below). */
-uint8_t* CHUNKUNROLL(uint8_t *out, unsigned *dist, unsigned *len) {
+ZLIB_INTERNAL uint8_t* CHUNKUNROLL(uint8_t *out, unsigned *dist, unsigned *len) {
     unsigned char const *from = out - *dist;
     chunk_t chunk;
     while (*dist < *len && *dist < sizeof(chunk_t)) {
@@ -84,7 +84,7 @@ uint8_t* CHUNKUNROLL(uint8_t *out, unsigned *dist, unsigned *len) {
 
 /* Copy DIST bytes from OUT - DIST into OUT + DIST * k, for 0 <= k < LEN/DIST.
    Return OUT + LEN. */
-uint8_t* CHUNKMEMSET(uint8_t *out, unsigned dist, unsigned len) {
+ZLIB_INTERNAL uint8_t* CHUNKMEMSET(uint8_t *out, unsigned dist, unsigned len) {
     /* Debug performance related issues when len < sizeof(uint64_t):
        Assert(len >= sizeof(uint64_t), "chunkmemset should be called on larger chunks"); */
     Assert(dist > 0, "cannot have a distance 0");
@@ -153,7 +153,7 @@ uint8_t* CHUNKMEMSET(uint8_t *out, unsigned dist, unsigned len) {
     return out;
 }
 
-uint8_t* CHUNKMEMSET_SAFE(uint8_t *out, unsigned dist, unsigned len, unsigned left) {
+ZLIB_INTERNAL uint8_t* CHUNKMEMSET_SAFE(uint8_t *out, unsigned dist, unsigned len, unsigned left) {
     if (left < (unsigned)(3 * sizeof(chunk_t))) {
         while (len > 0) {
             *out = *(out - dist);
index c1b74c5032237dc0fb9f1073fca758bb810bef40..0f8d2b32eb1f47284fcc0f6c1c853485581e298c 100644 (file)
@@ -53,7 +53,7 @@ static inline int32_t compare258_c_static(const unsigned char *src0, const unsig
     return compare256_c_static(src0, src1) + 2;
 }
 
-int32_t compare258_c(const unsigned char *src0, const unsigned char *src1) {
+ZLIB_INTERNAL int32_t compare258_c(const unsigned char *src0, const unsigned char *src1) {
     return compare258_c_static(src0, src1);
 }
 
@@ -93,7 +93,7 @@ static inline int32_t compare258_unaligned_16_static(const unsigned char *src0,
     return compare256_unaligned_16_static(src0+2, src1+2) + 2;
 }
 
-int32_t compare258_unaligned_16(const unsigned char *src0, const unsigned char *src1) {
+ZLIB_INTERNAL int32_t compare258_unaligned_16(const unsigned char *src0, const unsigned char *src1) {
     return compare258_unaligned_16_static(src0, src1);
 }
 
@@ -131,7 +131,7 @@ static inline int32_t compare258_unaligned_32_static(const unsigned char *src0,
     return compare256_unaligned_32_static(src0+2, src1+2) + 2;
 }
 
-int32_t compare258_unaligned_32(const unsigned char *src0, const unsigned char *src1) {
+ZLIB_INTERNAL int32_t compare258_unaligned_32(const unsigned char *src0, const unsigned char *src1) {
     return compare258_unaligned_32_static(src0, src1);
 }
 
@@ -171,7 +171,7 @@ static inline int32_t compare258_unaligned_64_static(const unsigned char *src0,
     return compare256_unaligned_64_static(src0+2, src1+2) + 2;
 }
 
-int32_t compare258_unaligned_64(const unsigned char *src0, const unsigned char *src1) {
+ZLIB_INTERNAL int32_t compare258_unaligned_64(const unsigned char *src0, const unsigned char *src1) {
     return compare258_unaligned_64_static(src0, src1);
 }
 
index 815c5219159256b5e8c297b6f498cceb5d082d93..20e7f667f389658205f4f2ab0728aba08ee6017f 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -52,7 +52,7 @@
 #include "deflate_p.h"
 #include "functable.h"
 
-const char zng_deflate_copyright[] = " deflate 1.2.11.f Copyright 1995-2016 Jean-loup Gailly and Mark Adler ";
+const char PREFIX(deflate_copyright)[] = " deflate 1.2.12.f Copyright 1995-2016 Jean-loup Gailly and Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
index b7c0e3cb76fdfb151cb1d9c458eaa2b1f513f445..f19b83a0286cc2ab947df49ee5a7e1eb9182ac17 100644 (file)
@@ -9,7 +9,7 @@
 
 #define MAXBITS 15
 
-const char zng_inflate_copyright[] = " inflate 1.2.11.f Copyright 1995-2016 Mark Adler ";
+const char PREFIX(inflate_copyright)[] = " inflate 1.2.12.f Copyright 1995-2016 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
index fc1223fd3f0296db6573852dfc141ad3fade7ebb..ddfaf4082baad1df5e5d559d4538711f51406b55 100644 (file)
@@ -29,7 +29,7 @@ typedef uint8_t         bestcmp_t;
  * string (strstart) and its distance is <= MAX_DIST, and prev_length >=1
  * OUT assertion: the match length is not greater than s->lookahead
  */
-int32_t LONGEST_MATCH(deflate_state *const s, Pos cur_match) {
+ZLIB_INTERNAL int32_t LONGEST_MATCH(deflate_state *const s, Pos cur_match) {
     unsigned int strstart = s->strstart;
     const unsigned wmask = s->w_mask;
     ZLIB_REGISTER unsigned char *window = s->window;
index 28436d47e73d365c5b49135eb7fe197480efc1c2..f608f2bd519433fc31027507cc56ff819a82eb31 100644 (file)
--- a/zlib.map
+++ b/zlib.map
@@ -91,6 +91,10 @@ ZLIB_1.2.9 {
     deflateGetDictionary;
     adler32_z;
     crc32_z;
+} ZLIB_1.2.7.1;
+
+ZLIB_1.2.12 {
     crc32_combine_gen;
+    crc32_combine_gen64;
     crc32_combine_op;
-} ZLIB_1.2.7.1;
+} ZLIB_1.2.9;
diff --git a/zutil.c b/zutil.c
index 197a2c541f96dca5d9a5eb8ee6eb0fd8f7721dfc..5d03fc5ce14e9d4dc259df4a4dac0c0175bfbedd 100644 (file)
--- a/zutil.c
+++ b/zutil.c
@@ -9,7 +9,7 @@
 #  include "gzguts.h"
 #endif
 
-const char * const zng_errmsg[10] = {
+const char * const PREFIX(z_errmsg)[10] = {
     (const char *)"need dictionary",     /* Z_NEED_DICT       2  */
     (const char *)"stream end",          /* Z_STREAM_END      1  */
     (const char *)"",                    /* Z_OK              0  */
@@ -23,7 +23,7 @@ const char * const zng_errmsg[10] = {
 };
 
 const char zlibng_string[] =
-    " zlib-ng 1.9.9 forked from zlib 1.2.11 ";
+    " zlib-ng 1.9.9 forked from zlib 1.2.12.f ";
 
 #ifdef ZLIB_COMPAT
 const char * ZEXPORT zlibVersion(void) {
diff --git a/zutil.h b/zutil.h
index 74dd781dcfe31c96f383975e276d6d6ad62ae29d..1b918d9c9794a053e04f8bc58d7e6d748743e5a4 100644 (file)
--- a/zutil.h
+++ b/zutil.h
 #else
 #  include "zlib-ng.h"
 #endif
+#include "zbuild.h"
 
 typedef unsigned char uch; /* Included for compatibility with external code only */
 typedef uint16_t ush;      /* Included for compatibility with external code only */
 typedef unsigned long ulg;
 
-extern const char * const zng_errmsg[10]; /* indexed by 2-zlib_error */
+extern const char * const PREFIX(z_errmsg)[10]; /* indexed by 2-zlib_error */
 /* (size given to avoid silly warnings with Visual C++) */
 
-#define ERR_MSG(err) zng_errmsg[Z_NEED_DICT-(err)]
+#define ERR_MSG(err) PREFIX(z_errmsg)[Z_NEED_DICT-(err)]
 
 #define ERR_RETURN(strm, err) return (strm->msg = ERR_MSG(err), (err))
 /* To be used only when the state is known to be valid */
@@ -122,7 +123,7 @@ extern const char * const zng_errmsg[10]; /* indexed by 2-zlib_error */
 
 /* MS Visual Studio does not allow inline in C, only C++.
    But it provides __inline instead, so use that. */
-#if defined(_MSC_VER) && !defined(inline) && !defined(__cplusplus) 
+#if defined(_MSC_VER) && !defined(inline) && !defined(__cplusplus)
 #  define inline __inline
 #endif
 
@@ -200,7 +201,7 @@ void ZLIB_INTERNAL   zng_cfree(void *opaque, void *ptr);
 #else
 #  define ZSWAP16(q) ((((q) & 0xff) << 8) | (((q) & 0xff00) >> 8))
 #  define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
-                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
+                     (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
 #  define ZSWAP64(q)                           \
           ((q & 0xFF00000000000000u) >> 56u) | \
           ((q & 0x00FF000000000000u) >> 40u) | \