]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Rename ZLIB_INTERNAL to Z_INTERNAL for consistency.
authorNathan Moinvaziri <nathan@solidstatenetworks.com>
Sun, 23 Aug 2020 01:24:10 +0000 (18:24 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 31 Aug 2020 10:33:16 +0000 (12:33 +0200)
57 files changed:
CMakeLists.txt
adler32.c
arch/arm/arm.h
arch/arm/armfeature.c
arch/arm/slide_neon.c
arch/power/power.c
arch/power/power.h
arch/power/slide_hash_power8.c
arch/s390/dfltcc_common.c
arch/s390/dfltcc_common.h
arch/s390/dfltcc_deflate.c
arch/s390/dfltcc_deflate.h
arch/s390/dfltcc_inflate.c
arch/s390/dfltcc_inflate.h
arch/x86/adler32_avx.c
arch/x86/adler32_ssse3.c
arch/x86/compare258_avx.c
arch/x86/compare258_sse.c
arch/x86/crc_folding.c
arch/x86/crc_folding.h
arch/x86/slide_avx.c
arch/x86/slide_sse.c
arch/x86/x86.c
arch/x86/x86.h
chunkset_tpl.h
compare258.c
configure
crc32.c
deflate.c
deflate.h
deflate_fast.c
deflate_medium.c
deflate_p.h
deflate_quick.c
deflate_slow.c
functable.c
functable.h
gzguts.h
gzlib.c
inffast.c
inffast.h
inflate.c
inflate.h
inftrees.c
inftrees.h
insert_string_tpl.h
match_tpl.h
tools/makefixed.c
tools/maketrees.c
trees.c
trees_emit.h
trees_tbl.h
uncompr.c
zconf-ng.h.in
zconf.h.in
zutil.c
zutil.h

index 5a58e7fc289ffa95cf004ca6e7fc0c53376e82a7..b42d81642169725d6aa454e35bce4460c5c828d4 100644 (file)
@@ -374,8 +374,8 @@ endif()
 # Check if we can hide zlib internal symbols that are linked between separate source files using hidden
 #
 check_c_source_compiles(
-    "#define ZLIB_INTERNAL __attribute__((visibility (\"hidden\")))
-    int ZLIB_INTERNAL foo;
+    "#define Z_INTERNAL __attribute__((visibility (\"hidden\")))
+    int Z_INTERNAL foo;
     int main()
     {
       return 0;
@@ -389,8 +389,8 @@ endif()
 # Check if we can hide zlib internal symbols that are linked between separate source files using internal
 #
 check_c_source_compiles(
-    "#define ZLIB_INTERNAL __attribute__((visibility (\"internal\")))
-    int ZLIB_INTERNAL foo;
+    "#define Z_INTERNAL __attribute__((visibility (\"internal\")))
+    int Z_INTERNAL foo;
     int main()
     {
       return 0;
index 989d7b4e3e38a216418d3bf9c157b7d46b6d0cd2..853858df1302900bd46ec3780d202f78f1310ba8 100644 (file)
--- a/adler32.c
+++ b/adler32.c
@@ -9,7 +9,7 @@
 #include "adler32_p.h"
 
 /* ========================================================================= */
-ZLIB_INTERNAL uint32_t adler32_c(uint32_t adler, const unsigned char *buf, size_t len) {
+Z_INTERNAL uint32_t adler32_c(uint32_t adler, const unsigned char *buf, size_t len) {
     uint32_t sum2;
     unsigned n;
 
index baee87f18077b39b0e5ce05f2e48707a9f890742..378006efbd2624e34a4003e3ca55361a46e7d6f0 100644 (file)
@@ -8,6 +8,6 @@
 extern int arm_cpu_has_neon;
 extern int arm_cpu_has_crc32;
 
-void ZLIB_INTERNAL arm_check_features(void);
+void Z_INTERNAL arm_check_features(void);
 
 #endif /* ARM_H_ */
index 9ad9eed6387d07b160b0b9392f6d9bd5d07035f5..27e06b8d5494900c3201ab24fb3b5a31dd82906f 100644 (file)
@@ -36,10 +36,10 @@ static inline int arm_has_neon() {
 }
 #endif
 
-ZLIB_INTERNAL int arm_cpu_has_neon;
-ZLIB_INTERNAL int arm_cpu_has_crc32;
+Z_INTERNAL int arm_cpu_has_neon;
+Z_INTERNAL int arm_cpu_has_crc32;
 
-void ZLIB_INTERNAL arm_check_features(void) {
+void Z_INTERNAL arm_check_features(void) {
 #if defined(__aarch64__) || defined(_M_ARM64)
     arm_cpu_has_neon = 1; /* always available */
 #else
index 8b1736db958561ceb73607cfa657fa04675009d3..f64fa5b5b40107727a8fa32ace4c0b9359778eaa 100644 (file)
@@ -43,7 +43,7 @@ static inline void slide_hash_chain(Pos *table, unsigned int entries, uint16_t w
     } while (--n);
 }
 
-ZLIB_INTERNAL void slide_hash_neon(deflate_state *s) {
+Z_INTERNAL void slide_hash_neon(deflate_state *s) {
     unsigned int wsize = s->w_size;
 
     slide_hash_chain(s->head, HASH_SIZE, wsize);
index 200fe453c62ff09af4752f3649ece935db7df1c0..f93b586d5076676eb8f5e0b435c4e98aef3ace43 100644 (file)
@@ -6,9 +6,9 @@
 #include <sys/auxv.h>
 #include "../../zutil.h"
 
-ZLIB_INTERNAL int power_cpu_has_arch_2_07;
+Z_INTERNAL int power_cpu_has_arch_2_07;
 
-void ZLIB_INTERNAL power_check_features(void) {
+void Z_INTERNAL power_check_features(void) {
     unsigned long hwcap2;
     hwcap2 = getauxval(AT_HWCAP2);
 
index 4ce63841b45f6232e46c15266062ea47e8ec6a8a..b36c26141024d2877f6d9bbda0e49ceb6d8616bf 100644 (file)
@@ -8,6 +8,6 @@
 
 extern int power_cpu_has_arch_2_07;
 
-void ZLIB_INTERNAL power_check_features(void);
+void Z_INTERNAL power_check_features(void);
 
 #endif /* POWER_H_ */
index 8bd79dfa8afda7161529a1bc38e8a31bace090b4..b1e30cea099e1a61261fdc56b4115154442413a5 100644 (file)
@@ -44,7 +44,7 @@ static inline void slide_hash_power8_loop(deflate_state *s, unsigned n_elems, Po
     } while (--chunks);
 }
 
-void ZLIB_INTERNAL slide_hash_power8(deflate_state *s) {
+void Z_INTERNAL slide_hash_power8(deflate_state *s) {
     unsigned int n;
     Pos *p;
 
index f80d76bd88be77ae5abcce16904c27661530ee51..c82c3b220c505aa0a20711770bc8e540e4e19e6b 100644 (file)
@@ -35,7 +35,7 @@ static inline int is_dfltcc_enabled(void) {
     return is_bit_set((const char *)facilities, DFLTCC_FACILITY);
 }
 
-void ZLIB_INTERNAL dfltcc_reset(PREFIX3(streamp) strm, uInt size) {
+void Z_INTERNAL dfltcc_reset(PREFIX3(streamp) strm, uInt size) {
     struct dfltcc_state *dfltcc_state = (struct dfltcc_state *)((char *)strm->state + ALIGN_UP(size, 8));
     struct dfltcc_qaf_param *param = (struct dfltcc_qaf_param *)&dfltcc_state->param;
 
@@ -58,17 +58,17 @@ void ZLIB_INTERNAL dfltcc_reset(PREFIX3(streamp) strm, uInt size) {
     dfltcc_state->param.ribm = DFLTCC_RIBM;
 }
 
-void ZLIB_INTERNAL *dfltcc_alloc_state(PREFIX3(streamp) strm, uInt items, uInt size) {
+void Z_INTERNAL *dfltcc_alloc_state(PREFIX3(streamp) strm, uInt items, uInt size) {
     return ZALLOC(strm, ALIGN_UP(items * size, 8) + sizeof(struct dfltcc_state), sizeof(unsigned char));
 }
 
-void ZLIB_INTERNAL dfltcc_copy_state(void *dst, const void *src, uInt size) {
+void Z_INTERNAL dfltcc_copy_state(void *dst, const void *src, uInt size) {
     memcpy(dst, src, ALIGN_UP(size, 8) + sizeof(struct dfltcc_state));
 }
 
 static const int PAGE_ALIGN = 0x1000;
 
-void ZLIB_INTERNAL *dfltcc_alloc_window(PREFIX3(streamp) strm, uInt items, uInt size) {
+void Z_INTERNAL *dfltcc_alloc_window(PREFIX3(streamp) strm, uInt items, uInt size) {
     void *p;
     void *w;
 
@@ -83,7 +83,7 @@ void ZLIB_INTERNAL *dfltcc_alloc_window(PREFIX3(streamp) strm, uInt items, uInt
     return w;
 }
 
-void ZLIB_INTERNAL dfltcc_free_window(PREFIX3(streamp) strm, void *w) {
+void Z_INTERNAL dfltcc_free_window(PREFIX3(streamp) strm, void *w) {
     if (w)
         ZFREE(strm, *(void **)((unsigned char *)w - sizeof(void *)));
 }
index 1b153c8a0374ab87720f33ad62ed64b9c7600783..5c3be91b970c53d9ecadcd6f118c0918efca0743 100644 (file)
@@ -8,11 +8,11 @@
 #endif
 #include "../../zutil.h"
 
-void ZLIB_INTERNAL *dfltcc_alloc_state(PREFIX3(streamp) strm, uInt items, uInt size);
-void ZLIB_INTERNAL dfltcc_copy_state(void *dst, const void *src, uInt size);
-void ZLIB_INTERNAL dfltcc_reset(PREFIX3(streamp) strm, uInt size);
-void ZLIB_INTERNAL *dfltcc_alloc_window(PREFIX3(streamp) strm, uInt items, uInt size);
-void ZLIB_INTERNAL dfltcc_free_window(PREFIX3(streamp) strm, void *w);
+void Z_INTERNAL *dfltcc_alloc_state(PREFIX3(streamp) strm, uInt items, uInt size);
+void Z_INTERNAL dfltcc_copy_state(void *dst, const void *src, uInt size);
+void Z_INTERNAL dfltcc_reset(PREFIX3(streamp) strm, uInt size);
+void Z_INTERNAL *dfltcc_alloc_window(PREFIX3(streamp) strm, uInt items, uInt size);
+void Z_INTERNAL dfltcc_free_window(PREFIX3(streamp) strm, void *w);
 
 #define ZALLOC_STATE dfltcc_alloc_state
 
index 4db18fe40421c73a72fac3e7cd370a17532ed34c..187865667621de772b39d7475c8e12c727d95c0a 100644 (file)
@@ -44,7 +44,7 @@ static inline int dfltcc_can_deflate_with_params(PREFIX3(streamp) strm, int leve
     return 1;
 }
 
-int ZLIB_INTERNAL dfltcc_can_deflate(PREFIX3(streamp) strm) {
+int Z_INTERNAL dfltcc_can_deflate(PREFIX3(streamp) strm) {
     deflate_state *state = (deflate_state *)strm->state;
 
     return dfltcc_can_deflate_with_params(strm, state->level, state->w_bits, state->strategy, state->reproducible);
@@ -95,7 +95,7 @@ static inline void send_eobs(PREFIX3(streamp) strm, const struct dfltcc_param_v0
 #endif
 }
 
-int ZLIB_INTERNAL dfltcc_deflate(PREFIX3(streamp) strm, int flush, block_state *result) {
+int Z_INTERNAL dfltcc_deflate(PREFIX3(streamp) strm, int flush, block_state *result) {
     deflate_state *state = (deflate_state *)strm->state;
     struct dfltcc_state *dfltcc_state = GET_DFLTCC_STATE(state);
     struct dfltcc_param_v0 *param = &dfltcc_state->param;
@@ -297,7 +297,7 @@ static int dfltcc_was_deflate_used(PREFIX3(streamp) strm) {
     return strm->total_in > 0 || param->nt == 0 || param->hl > 0;
 }
 
-int ZLIB_INTERNAL dfltcc_deflate_params(PREFIX3(streamp) strm, int level, int strategy, int *flush) {
+int Z_INTERNAL dfltcc_deflate_params(PREFIX3(streamp) strm, int level, int strategy, int *flush) {
     deflate_state *state = (deflate_state *)strm->state;
     int could_deflate = dfltcc_can_deflate(strm);
     int can_deflate = dfltcc_can_deflate_with_params(strm, level, state->w_bits, strategy, state->reproducible);
@@ -315,7 +315,7 @@ int ZLIB_INTERNAL dfltcc_deflate_params(PREFIX3(streamp) strm, int level, int st
     return Z_OK;
 }
 
-int ZLIB_INTERNAL dfltcc_deflate_done(PREFIX3(streamp) strm, int flush) {
+int Z_INTERNAL dfltcc_deflate_done(PREFIX3(streamp) strm, int flush) {
     deflate_state *state = (deflate_state *)strm->state;
     struct dfltcc_state *dfltcc_state = GET_DFLTCC_STATE(state);
     struct dfltcc_param_v0 *param = &dfltcc_state->param;
@@ -334,7 +334,7 @@ int ZLIB_INTERNAL dfltcc_deflate_done(PREFIX3(streamp) strm, int flush) {
     return !dfltcc_can_deflate(strm) || (!param->cf && !param->bcf);
 }
 
-int ZLIB_INTERNAL dfltcc_can_set_reproducible(PREFIX3(streamp) strm, int reproducible) {
+int Z_INTERNAL dfltcc_can_set_reproducible(PREFIX3(streamp) strm, int reproducible) {
     deflate_state *state = (deflate_state *)strm->state;
 
     return reproducible != state->reproducible && !dfltcc_was_deflate_used(strm);
@@ -373,7 +373,7 @@ static void append_history(struct dfltcc_param_v0 *param, unsigned char *history
     }
 }
 
-int ZLIB_INTERNAL dfltcc_deflate_set_dictionary(PREFIX3(streamp) strm,
+int Z_INTERNAL dfltcc_deflate_set_dictionary(PREFIX3(streamp) strm,
                                                 const unsigned char *dictionary, uInt dict_length) {
     deflate_state *state = (deflate_state *)strm->state;
     struct dfltcc_state *dfltcc_state = GET_DFLTCC_STATE(state);
@@ -385,7 +385,7 @@ int ZLIB_INTERNAL dfltcc_deflate_set_dictionary(PREFIX3(streamp) strm,
     return Z_OK;
 }
 
-int ZLIB_INTERNAL dfltcc_deflate_get_dictionary(PREFIX3(streamp) strm, unsigned char *dictionary, uInt *dict_length) {
+int Z_INTERNAL dfltcc_deflate_get_dictionary(PREFIX3(streamp) strm, unsigned char *dictionary, uInt *dict_length) {
     deflate_state *state = (deflate_state *)strm->state;
     struct dfltcc_state *dfltcc_state = GET_DFLTCC_STATE(state);
     struct dfltcc_param_v0 *param = &dfltcc_state->param;
index d4c9143d71326cd1e2978670322ad390c191543f..7e32380bd8923e19d3aa882162a0d2386b82a1df 100644 (file)
@@ -3,14 +3,14 @@
 
 #include "dfltcc_common.h"
 
-int ZLIB_INTERNAL dfltcc_can_deflate(PREFIX3(streamp) strm);
-int ZLIB_INTERNAL dfltcc_deflate(PREFIX3(streamp) strm, int flush, block_state *result);
-int ZLIB_INTERNAL dfltcc_deflate_params(PREFIX3(streamp) strm, int level, int strategy, int *flush);
-int ZLIB_INTERNAL dfltcc_deflate_done(PREFIX3(streamp) strm, int flush);
-int ZLIB_INTERNAL dfltcc_can_set_reproducible(PREFIX3(streamp) strm, int reproducible);
-int ZLIB_INTERNAL dfltcc_deflate_set_dictionary(PREFIX3(streamp) strm,
+int Z_INTERNAL dfltcc_can_deflate(PREFIX3(streamp) strm);
+int Z_INTERNAL dfltcc_deflate(PREFIX3(streamp) strm, int flush, block_state *result);
+int Z_INTERNAL dfltcc_deflate_params(PREFIX3(streamp) strm, int level, int strategy, int *flush);
+int Z_INTERNAL dfltcc_deflate_done(PREFIX3(streamp) strm, int flush);
+int Z_INTERNAL dfltcc_can_set_reproducible(PREFIX3(streamp) strm, int reproducible);
+int Z_INTERNAL dfltcc_deflate_set_dictionary(PREFIX3(streamp) strm,
                                                 const unsigned char *dictionary, uInt dict_length);
-int ZLIB_INTERNAL dfltcc_deflate_get_dictionary(PREFIX3(streamp) strm, unsigned char *dictionary, uInt* dict_length);
+int Z_INTERNAL dfltcc_deflate_get_dictionary(PREFIX3(streamp) strm, unsigned char *dictionary, uInt* dict_length);
 
 #define DEFLATE_SET_DICTIONARY_HOOK(strm, dict, dict_len) \
     do { \
index ad17fe88bfb10e3b7a0044f34c5bc85598ecb6a1..f6a7e8f8650c4e2030e720e8df961fef67da7e00 100644 (file)
@@ -20,7 +20,7 @@
 #include "dfltcc_inflate.h"
 #include "dfltcc_detail.h"
 
-int ZLIB_INTERNAL dfltcc_can_inflate(PREFIX3(streamp) strm) {
+int Z_INTERNAL dfltcc_can_inflate(PREFIX3(streamp) strm) {
     struct inflate_state *state = (struct inflate_state *)strm->state;
     struct dfltcc_state *dfltcc_state = GET_DFLTCC_STATE(state);
 
@@ -47,7 +47,7 @@ static inline dfltcc_cc dfltcc_xpnd(PREFIX3(streamp) strm) {
     return cc;
 }
 
-dfltcc_inflate_action ZLIB_INTERNAL dfltcc_inflate(PREFIX3(streamp) strm, int flush, int *ret) {
+dfltcc_inflate_action Z_INTERNAL dfltcc_inflate(PREFIX3(streamp) strm, int flush, int *ret) {
     struct inflate_state *state = (struct inflate_state *)strm->state;
     struct dfltcc_state *dfltcc_state = GET_DFLTCC_STATE(state);
     struct dfltcc_param_v0 *param = &dfltcc_state->param;
@@ -112,14 +112,14 @@ dfltcc_inflate_action ZLIB_INTERNAL dfltcc_inflate(PREFIX3(streamp) strm, int fl
         DFLTCC_INFLATE_BREAK : DFLTCC_INFLATE_CONTINUE;
 }
 
-int ZLIB_INTERNAL dfltcc_was_inflate_used(PREFIX3(streamp) strm) {
+int Z_INTERNAL dfltcc_was_inflate_used(PREFIX3(streamp) strm) {
     struct inflate_state *state = (struct inflate_state *)strm->state;
     struct dfltcc_param_v0 *param = &GET_DFLTCC_STATE(state)->param;
 
     return !param->nt;
 }
 
-int ZLIB_INTERNAL dfltcc_inflate_disable(PREFIX3(streamp) strm) {
+int Z_INTERNAL dfltcc_inflate_disable(PREFIX3(streamp) strm) {
     struct inflate_state *state = (struct inflate_state *)strm->state;
     struct dfltcc_state *dfltcc_state = GET_DFLTCC_STATE(state);
 
index aea2bbb73bac1f64afd58fa82fcff681aadd7c28..b293ebbec40ef7608837374b4a75e99732233ba2 100644 (file)
@@ -3,15 +3,15 @@
 
 #include "dfltcc_common.h"
 
-int ZLIB_INTERNAL dfltcc_can_inflate(PREFIX3(streamp) strm);
+int Z_INTERNAL dfltcc_can_inflate(PREFIX3(streamp) strm);
 typedef enum {
     DFLTCC_INFLATE_CONTINUE,
     DFLTCC_INFLATE_BREAK,
     DFLTCC_INFLATE_SOFTWARE,
 } dfltcc_inflate_action;
-dfltcc_inflate_action ZLIB_INTERNAL dfltcc_inflate(PREFIX3(streamp) strm, int flush, int *ret);
-int ZLIB_INTERNAL dfltcc_was_inflate_used(PREFIX3(streamp) strm);
-int ZLIB_INTERNAL dfltcc_inflate_disable(PREFIX3(streamp) strm);
+dfltcc_inflate_action Z_INTERNAL dfltcc_inflate(PREFIX3(streamp) strm, int flush, int *ret);
+int Z_INTERNAL dfltcc_was_inflate_used(PREFIX3(streamp) strm);
+int Z_INTERNAL dfltcc_inflate_disable(PREFIX3(streamp) strm);
 
 #define INFLATE_RESET_KEEP_HOOK(strm) \
     dfltcc_reset((strm), sizeof(struct inflate_state))
index 60d3da4b93c4e4577ab925e253cf1b961b3f6d55..1063246549f215a21feda86c0937f571acfe1c22 100644 (file)
@@ -14,7 +14,7 @@
 
 #ifdef X86_AVX2_ADLER32
 
-ZLIB_INTERNAL uint32_t adler32_avx2(uint32_t adler, const unsigned char *buf, size_t len) {
+Z_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 c1a48e9823c6854a290eaf91aeab5e905f52c0c2..101df4fe4d64ddcb6477709cf4d013c5015ac3f4 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <immintrin.h>
 
-ZLIB_INTERNAL uint32_t adler32_ssse3(uint32_t adler, const unsigned char *buf, size_t len) {
+Z_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 ef5fa8cec8cd84b8c862af5e3ed82db6337be6c4..8b708b60ed2457a0360d38e312189471f6ea9da6 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;
 }
 
-ZLIB_INTERNAL int32_t compare258_unaligned_avx2(const unsigned char *src0, const unsigned char *src1) {
+Z_INTERNAL int32_t compare258_unaligned_avx2(const unsigned char *src0, const unsigned char *src1) {
     return compare258_unaligned_avx2_static(src0, src1);
 }
 
index 1cf7b0fb0bf127d033ba355c94646f8ee4284e17..6f2af8e64c78fffc667d24df016312e2e79eca92 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;
 }
 
-ZLIB_INTERNAL int32_t compare258_unaligned_sse4(const unsigned char *src0, const unsigned char *src1) {
+Z_INTERNAL int32_t compare258_unaligned_sse4(const unsigned char *src0, const unsigned char *src1) {
     return compare258_unaligned_sse4_static(src0, src1);
 }
 
index 4c63b6abf1cc494d0c341d307369fc7c0d34e18a..8e32d97b61fcdace9daef53cb6bdb710cbec214e 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "crc_folding.h"
 
-ZLIB_INTERNAL void crc_fold_init(deflate_state *const s) {
+Z_INTERNAL void crc_fold_init(deflate_state *const s) {
     /* CRC_SAVE */
     _mm_storeu_si128((__m128i *)s->crc0 + 0, _mm_cvtsi32_si128(0x9db42487));
     _mm_storeu_si128((__m128i *)s->crc0 + 1, _mm_setzero_si128());
@@ -227,7 +227,7 @@ static void partial_fold(const size_t len, __m128i *xmm_crc0, __m128i *xmm_crc1,
     *xmm_crc3 = _mm_castps_si128(ps_res);
 }
 
-ZLIB_INTERNAL void crc_fold_copy(deflate_state *const s, unsigned char *dst, const unsigned char *src, long len) {
+Z_INTERNAL void crc_fold_copy(deflate_state *const s, unsigned char *dst, const unsigned char *src, long len) {
     unsigned long algn_diff;
     __m128i xmm_t0, xmm_t1, xmm_t2, xmm_t3;
     char ALIGNED_(16) partial_buf[16] = { 0 };
@@ -385,7 +385,7 @@ static const unsigned ALIGNED_(16) crc_mask2[4] = {
     0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
 };
 
-uint32_t ZLIB_INTERNAL crc_fold_512to32(deflate_state *const s) {
+uint32_t Z_INTERNAL crc_fold_512to32(deflate_state *const s) {
     const __m128i xmm_mask  = _mm_load_si128((__m128i *)crc_mask);
     const __m128i xmm_mask2 = _mm_load_si128((__m128i *)crc_mask2);
 
@@ -455,4 +455,3 @@ uint32_t ZLIB_INTERNAL crc_fold_512to32(deflate_state *const s) {
 }
 
 #endif
-
index 71b84533e4d7ff7e6883d83900ff2c23d59c89b3..0d3c24b29ffde375290b2739ba226c289af8313a 100644 (file)
@@ -12,8 +12,8 @@
 
 #include "../../deflate.h"
 
-ZLIB_INTERNAL void crc_fold_init(deflate_state *const);
-ZLIB_INTERNAL uint32_t crc_fold_512to32(deflate_state *const);
-ZLIB_INTERNAL void crc_fold_copy(deflate_state *const, unsigned char *, const unsigned char *, long);
+Z_INTERNAL void crc_fold_init(deflate_state *const);
+Z_INTERNAL uint32_t crc_fold_512to32(deflate_state *const);
+Z_INTERNAL void crc_fold_copy(deflate_state *const, unsigned char *, const unsigned char *, long);
 
 #endif
index 42ba91214451be5f8c82d41b0f451fe3d485830a..c89f107f2f496166e47eb0d7cb8c1c1e5552cf3f 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <immintrin.h>
 
-ZLIB_INTERNAL void slide_hash_avx2(deflate_state *s) {
+Z_INTERNAL void slide_hash_avx2(deflate_state *s) {
     Pos *p;
     unsigned n;
     uint16_t wsize = (uint16_t)s->w_size;
index 7ae79a828bb40cfb7f9fe1072a630ff7c635098f..7c9ee6be0f49e60a3d44801d885227e31fc2dd17 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <immintrin.h>
 
-ZLIB_INTERNAL void slide_hash_sse2(deflate_state *s) {
+Z_INTERNAL void slide_hash_sse2(deflate_state *s) {
     Pos *p;
     unsigned n;
     uint16_t wsize = (uint16_t)s->w_size;
index 79f4203501b49c5ef9e536dc0089cc011cc8e74e..e782cb8ee34462399e76ae5854e40ff662e30b63 100644 (file)
 #  include <cpuid.h>
 #endif
 
-ZLIB_INTERNAL int x86_cpu_has_avx2;
-ZLIB_INTERNAL int x86_cpu_has_sse2;
-ZLIB_INTERNAL int x86_cpu_has_ssse3;
-ZLIB_INTERNAL int x86_cpu_has_sse42;
-ZLIB_INTERNAL int x86_cpu_has_pclmulqdq;
-ZLIB_INTERNAL int x86_cpu_has_tzcnt;
+Z_INTERNAL int x86_cpu_has_avx2;
+Z_INTERNAL int x86_cpu_has_sse2;
+Z_INTERNAL int x86_cpu_has_ssse3;
+Z_INTERNAL int x86_cpu_has_sse42;
+Z_INTERNAL int x86_cpu_has_pclmulqdq;
+Z_INTERNAL int x86_cpu_has_tzcnt;
 
 static void cpuid(int info, unsigned* eax, unsigned* ebx, unsigned* ecx, unsigned* edx) {
 #ifdef _MSC_VER
@@ -52,7 +52,7 @@ static void cpuidex(int info, int subinfo, unsigned* eax, unsigned* ebx, unsigne
 #endif
 }
 
-void ZLIB_INTERNAL x86_check_features(void) {
+void Z_INTERNAL x86_check_features(void) {
     unsigned eax, ebx, ecx, edx;
     unsigned maxbasic;
 
index 243a807ffb9085c090f96b06896e347c995c783b..8471e155cd8ba3a54fc40a563fa2f1005546df79 100644 (file)
@@ -13,6 +13,6 @@ extern int x86_cpu_has_sse42;
 extern int x86_cpu_has_pclmulqdq;
 extern int x86_cpu_has_tzcnt;
 
-void ZLIB_INTERNAL x86_check_features(void);
+void Z_INTERNAL x86_check_features(void);
 
 #endif /* CPU_H_ */
index 4abf1941319ba20d8a6f651c83bd87886390190e..1cd52f1d15c05f83d2c2ce8428daa92360af8146 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 /* Returns the chunk size */
-ZLIB_INTERNAL uint32_t CHUNKSIZE(void) {
+Z_INTERNAL uint32_t CHUNKSIZE(void) {
     return sizeof(chunk_t);
 }
 
@@ -17,7 +17,7 @@ ZLIB_INTERNAL 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. */
-ZLIB_INTERNAL uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
+Z_INTERNAL uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
     chunk_t chunk;
     --len;
     loadchunk(from, &chunk);
@@ -36,7 +36,7 @@ ZLIB_INTERNAL uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len
 }
 
 /* Behave like chunkcopy, but avoid writing beyond of legal output. */
-ZLIB_INTERNAL uint8_t* CHUNKCOPY_SAFE(uint8_t *out, uint8_t const *from, unsigned len, uint8_t *safe) {
+Z_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 @@ ZLIB_INTERNAL uint8_t* CHUNKCOPY_SAFE(uint8_t *out, uint8_t const *from, unsigne
    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). */
-ZLIB_INTERNAL uint8_t* CHUNKUNROLL(uint8_t *out, unsigned *dist, unsigned *len) {
+Z_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 @@ ZLIB_INTERNAL 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. */
-ZLIB_INTERNAL uint8_t* CHUNKMEMSET(uint8_t *out, unsigned dist, unsigned len) {
+Z_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 @@ ZLIB_INTERNAL uint8_t* CHUNKMEMSET(uint8_t *out, unsigned dist, unsigned len) {
     return out;
 }
 
-ZLIB_INTERNAL uint8_t* CHUNKMEMSET_SAFE(uint8_t *out, unsigned dist, unsigned len, unsigned left) {
+Z_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 0f8d2b32eb1f47284fcc0f6c1c853485581e298c..849c4e2a363f28dae3c06d16134fa325b27bd22d 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;
 }
 
-ZLIB_INTERNAL int32_t compare258_c(const unsigned char *src0, const unsigned char *src1) {
+Z_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;
 }
 
-ZLIB_INTERNAL int32_t compare258_unaligned_16(const unsigned char *src0, const unsigned char *src1) {
+Z_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;
 }
 
-ZLIB_INTERNAL int32_t compare258_unaligned_32(const unsigned char *src0, const unsigned char *src1) {
+Z_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;
 }
 
-ZLIB_INTERNAL int32_t compare258_unaligned_64(const unsigned char *src0, const unsigned char *src1) {
+Z_INTERNAL int32_t compare258_unaligned_64(const unsigned char *src0, const unsigned char *src1) {
     return compare258_unaligned_64_static(src0, src1);
 }
 
index df19fd3cd0b6c7ed84f2b8a42b7ee4bd67968d3e..cb627c1672fa836bcce060172fa1528b5906caf9 100755 (executable)
--- a/configure
+++ b/configure
@@ -832,8 +832,8 @@ fi
 if test "$gcc" -eq 1; then
   echo >> configure.log
   cat > $test.c <<EOF
-#define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
-int ZLIB_INTERNAL foo;
+#define Z_INTERNAL __attribute__((visibility ("hidden")))
+int Z_INTERNAL foo;
 int main() { return 0; }
 EOF
   if tryboth $CC -c $CFLAGS $test.c; then
@@ -851,8 +851,8 @@ fi
 if test "$gcc" -eq 1; then
   echo >> configure.log
   cat > $test.c <<EOF
-#define ZLIB_INTERNAL __attribute__((visibility ("internal")))
-int ZLIB_INTERNAL foo;
+#define Z_INTERNAL __attribute__((visibility ("internal")))
+int Z_INTERNAL foo;
 int main() { return 0; }
 EOF
   if tryboth $CC -c $CFLAGS $test.c; then
diff --git a/crc32.c b/crc32.c
index 19b6a01937f284b1e9e902903fe4b6c0a384f44c..4133ed529e3742892d942fb0ae48ab995879ed2a 100644 (file)
--- a/crc32.c
+++ b/crc32.c
@@ -48,7 +48,7 @@ uint32_t ZEXPORT PREFIX(crc32_z)(uint32_t crc, const unsigned char *buf, size_t
 #define DO4 DO1; DO1; DO1; DO1
 
 /* ========================================================================= */
-ZLIB_INTERNAL uint32_t crc32_generic(uint32_t crc, const unsigned char *buf, uint64_t len) {
+Z_INTERNAL uint32_t crc32_generic(uint32_t crc, const unsigned char *buf, uint64_t len) {
     crc = crc ^ 0xffffffff;
 
 #ifdef UNROLL_MORE
@@ -99,7 +99,7 @@ uint32_t ZEXPORT PREFIX(crc32)(uint32_t crc, const unsigned char *buf, uint32_t
 #define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
 
 /* ========================================================================= */
-ZLIB_INTERNAL uint32_t crc32_little(uint32_t crc, const unsigned char *buf, uint64_t len) {
+Z_INTERNAL uint32_t crc32_little(uint32_t crc, const unsigned char *buf, uint64_t len) {
     Z_REGISTER uint32_t c;
     Z_REGISTER const uint32_t *buf4;
 
@@ -141,7 +141,7 @@ ZLIB_INTERNAL uint32_t crc32_little(uint32_t crc, const unsigned char *buf, uint
 #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
 
 /* ========================================================================= */
-ZLIB_INTERNAL uint32_t crc32_big(uint32_t crc, const unsigned char *buf, uint64_t len) {
+Z_INTERNAL uint32_t crc32_big(uint32_t crc, const unsigned char *buf, uint64_t len) {
     Z_REGISTER uint32_t c;
     Z_REGISTER const uint32_t *buf4;
 
@@ -207,13 +207,13 @@ uint32_t ZEXPORT PREFIX4(crc32_combine)(uint32_t crc1, uint32_t crc2, z_off64_t
 #include "arch/x86/x86.h"
 #include "arch/x86/crc_folding.h"
 
-ZLIB_INTERNAL void crc_finalize(deflate_state *const s) {
+Z_INTERNAL void crc_finalize(deflate_state *const s) {
     if (x86_cpu_has_pclmulqdq)
         s->strm->adler = crc_fold_512to32(s);
 }
 #endif
 
-ZLIB_INTERNAL void crc_reset(deflate_state *const s) {
+Z_INTERNAL void crc_reset(deflate_state *const s) {
 #ifdef X86_PCLMULQDQ_CRC
     x86_check_features();
     if (x86_cpu_has_pclmulqdq) {
@@ -224,7 +224,7 @@ ZLIB_INTERNAL void crc_reset(deflate_state *const s) {
     s->strm->adler = PREFIX(crc32)(0L, NULL, 0);
 }
 
-ZLIB_INTERNAL void copy_with_crc(PREFIX3(stream) *strm, unsigned char *dst, unsigned long size) {
+Z_INTERNAL void copy_with_crc(PREFIX3(stream) *strm, unsigned char *dst, unsigned long size) {
 #ifdef X86_PCLMULQDQ_CRC
     if (x86_cpu_has_pclmulqdq) {
         crc_fold_copy(strm->state, dst, strm->next_in, size);
index a78f4959ad7dbb3c0ac9692246cd7d259aa7c63f..37964fa28af39c961f83e50fcdf53c5bb6046856 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -105,16 +105,16 @@ typedef block_state (*compress_func) (deflate_state *s, int flush);
 
 static int deflateStateCheck      (PREFIX3(stream) *strm);
 static block_state deflate_stored (deflate_state *s, int flush);
-ZLIB_INTERNAL block_state deflate_fast         (deflate_state *s, int flush);
-ZLIB_INTERNAL block_state deflate_quick        (deflate_state *s, int flush);
+Z_INTERNAL block_state deflate_fast         (deflate_state *s, int flush);
+Z_INTERNAL block_state deflate_quick        (deflate_state *s, int flush);
 #ifndef NO_MEDIUM_STRATEGY
-ZLIB_INTERNAL block_state deflate_medium       (deflate_state *s, int flush);
+Z_INTERNAL block_state deflate_medium       (deflate_state *s, int flush);
 #endif
-ZLIB_INTERNAL block_state deflate_slow         (deflate_state *s, int flush);
+Z_INTERNAL block_state deflate_slow         (deflate_state *s, int flush);
 static block_state deflate_rle   (deflate_state *s, int flush);
 static block_state deflate_huff  (deflate_state *s, int flush);
 static void lm_init              (deflate_state *s);
-ZLIB_INTERNAL unsigned read_buf  (PREFIX3(stream) *strm, unsigned char *buf, unsigned size);
+Z_INTERNAL unsigned read_buf  (PREFIX3(stream) *strm, unsigned char *buf, unsigned size);
 
 extern void crc_reset(deflate_state *const s);
 #ifdef X86_PCLMULQDQ_CRC
@@ -191,7 +191,7 @@ static const config configuration_table[10] = {
  * bit values at the expense of memory usage). We slide even when level == 0 to
  * keep the hash table consistent if we switch back to level > 0 later.
  */
-ZLIB_INTERNAL void slide_hash_c(deflate_state *s) {
+Z_INTERNAL void slide_hash_c(deflate_state *s) {
     Pos *p;
     unsigned n;
     unsigned int wsize = s->w_size;
@@ -739,7 +739,7 @@ unsigned long ZEXPORT PREFIX(deflateBound)(PREFIX3(stream) *strm, unsigned long
  * applications may wish to modify it to avoid allocating a large
  * strm->next_out buffer and copying into it. (See also read_buf()).
  */
-ZLIB_INTERNAL void flush_pending(PREFIX3(stream) *strm) {
+Z_INTERNAL void flush_pending(PREFIX3(stream) *strm) {
     uint32_t len;
     deflate_state *s = strm->state;
 
@@ -1151,7 +1151,7 @@ int32_t ZEXPORT PREFIX(deflateCopy)(PREFIX3(stream) *dest, PREFIX3(stream) *sour
  * allocating a large strm->next_in buffer and copying from it.
  * (See also flush_pending()).
  */
-ZLIB_INTERNAL unsigned read_buf(PREFIX3(stream) *strm, unsigned char *buf, unsigned size) {
+Z_INTERNAL unsigned read_buf(PREFIX3(stream) *strm, unsigned char *buf, unsigned size) {
     uint32_t len = strm->avail_in;
 
     if (len > size)
@@ -1247,7 +1247,7 @@ void check_match(deflate_state *s, Pos start, Pos match, int length) {
  *    option -- not supported here).
  */
 
-void ZLIB_INTERNAL fill_window(deflate_state *s) {
+void Z_INTERNAL fill_window(deflate_state *s) {
     unsigned n;
     unsigned int more;    /* Amount of free space at the end of the window. */
     unsigned int wsize = s->w_size;
index 9087e2e24b46c75635ff2ddaab80bb45378967e2..11b9973f97aac6776b71ee3f9ac467a7df4aac33 100644 (file)
--- a/deflate.h
+++ b/deflate.h
@@ -101,7 +101,7 @@ typedef struct tree_desc_s {
 typedef uint16_t Pos;
 
 /* A Pos is an index in the character window. We use short instead of int to
- * save space in the various tables. 
+ * save space in the various tables.
  */
 
 typedef struct internal_state {
@@ -385,18 +385,17 @@ static inline void put_uint64(deflate_state *s, uint64_t lld) {
    memory checker errors from longest match routines */
 
 
-void ZLIB_INTERNAL fill_window(deflate_state *s);
-void ZLIB_INTERNAL slide_hash_c(deflate_state *s);
+void Z_INTERNAL fill_window(deflate_state *s);
+void Z_INTERNAL slide_hash_c(deflate_state *s);
 
         /* in trees.c */
-void ZLIB_INTERNAL zng_tr_init(deflate_state *s);
-void ZLIB_INTERNAL zng_tr_flush_block(deflate_state *s, char *buf, uint32_t stored_len, int last);
-void ZLIB_INTERNAL zng_tr_flush_bits(deflate_state *s);
-void ZLIB_INTERNAL zng_tr_align(deflate_state *s);
-void ZLIB_INTERNAL zng_tr_stored_block(deflate_state *s, char *buf, uint32_t stored_len, int last);
-unsigned ZLIB_INTERNAL bi_reverse(unsigned code, int len);
-void ZLIB_INTERNAL flush_pending(PREFIX3(streamp) strm);
-
+void Z_INTERNAL zng_tr_init(deflate_state *s);
+void Z_INTERNAL zng_tr_flush_block(deflate_state *s, char *buf, uint32_t stored_len, int last);
+void Z_INTERNAL zng_tr_flush_bits(deflate_state *s);
+void Z_INTERNAL zng_tr_align(deflate_state *s);
+void Z_INTERNAL zng_tr_stored_block(deflate_state *s, char *buf, uint32_t stored_len, int last);
+unsigned Z_INTERNAL bi_reverse(unsigned code, int len);
+void Z_INTERNAL flush_pending(PREFIX3(streamp) strm);
 #define d_code(dist) ((dist) < 256 ? zng_dist_code[dist] : zng_dist_code[256+((dist)>>7)])
 /* Mapping from a distance to a distance code. dist is the distance - 1 and
  * must not have side effects. zng_dist_code[256] and zng_dist_code[257] are never
index f2a4a59928457b00c859584954fd61fac63daace..a88e60272bab1d186a4867694b8e60cf36411f08 100644 (file)
@@ -16,7 +16,7 @@
  * new strings in the dictionary only for unmatched strings or for short
  * matches. It is used only for the fast compression options.
  */
-ZLIB_INTERNAL block_state deflate_fast(deflate_state *s, int flush) {
+Z_INTERNAL block_state deflate_fast(deflate_state *s, int flush) {
     Pos hash_head;        /* head of the hash chain */
     int bflush = 0;       /* set if current block must be flushed */
     uint32_t match_len = 0;
index db155311423853167e216d67fc9219dc0f69cfdb..d642c0141900bfce51e5ffba004ed7b465924f82 100644 (file)
@@ -160,7 +160,7 @@ static void fizzle_matches(deflate_state *s, struct match *current, struct match
     }
 }
 
-ZLIB_INTERNAL block_state deflate_medium(deflate_state *s, int flush) {
+Z_INTERNAL block_state deflate_medium(deflate_state *s, int flush) {
     /* Align the first struct to start on a new cacheline, this allows us to fit both structs in one cacheline */
     ALIGNED_(16) struct match current_match;
                  struct match next_match;
index 60ca1370f37bb25579237b6bebce145efd62b2e9..4c4000355899731e36c3a3d9f21b66e4d5770db0 100644 (file)
@@ -23,8 +23,8 @@ void flush_pending(PREFIX3(stream) *strm);
  * the current block must be flushed.
  */
 
-extern const unsigned char ZLIB_INTERNAL zng_length_code[];
-extern const unsigned char ZLIB_INTERNAL zng_dist_code[];
+extern const unsigned char Z_INTERNAL zng_length_code[];
+extern const unsigned char Z_INTERNAL zng_dist_code[];
 
 static inline int zng_tr_tally_lit(deflate_state *s, unsigned char c) {
     /* c is the unmatched char */
index c8fb226c4fcaa91c109613ed65767de0c0b3953c..3ed934cbda6e0ba8ce16626db958ded045bddafa 100644 (file)
@@ -43,7 +43,7 @@ extern const ct_data static_dtree[D_CODES];
     } \
 }
 
-ZLIB_INTERNAL block_state deflate_quick(deflate_state *s, int flush) {
+Z_INTERNAL block_state deflate_quick(deflate_state *s, int flush) {
     Pos hash_head;
     unsigned dist, match_len, last;
 
index 7c7f28bd05afb192ac8e03d794bc6c4e378aae91..af2f284494d09e25fe86482081ca2772de5cde23 100644 (file)
@@ -14,7 +14,7 @@
  * evaluation for matches: a match is finally adopted only if there is
  * no better match at the next window position.
  */
-ZLIB_INTERNAL block_state deflate_slow(deflate_state *s, int flush) {
+Z_INTERNAL block_state deflate_slow(deflate_state *s, int flush) {
     Pos hash_head;           /* head of hash chain */
     int bflush;              /* set if current block must be flushed */
     uint32_t match_len;
index 730fd26b79336c4e794b4db649d7d68eed5251ae..1d4fe2a542c6b9219284b866955645397c6da90d 100644 (file)
@@ -82,7 +82,7 @@ extern uint8_t* chunkmemset_safe_neon(uint8_t *out, unsigned dist, unsigned len,
 #endif
 
 /* CRC32 */
-ZLIB_INTERNAL uint32_t crc32_generic(uint32_t, const unsigned char *, uint64_t);
+Z_INTERNAL uint32_t crc32_generic(uint32_t, const unsigned char *, uint64_t);
 
 #ifdef ARM_ACLE_CRC_HASH
 extern uint32_t crc32_acle(uint32_t, const unsigned char *, uint64_t);
@@ -126,9 +126,9 @@ extern int32_t longest_match_unaligned_avx2(deflate_state *const s, Pos cur_matc
 #endif
 #endif
 
-ZLIB_INTERNAL Z_TLS struct functable_s functable;
+Z_INTERNAL Z_TLS struct functable_s functable;
 
-ZLIB_INTERNAL void cpu_check_features(void)
+Z_INTERNAL void cpu_check_features(void)
 {
     static int features_checked = 0;
     if (features_checked)
@@ -144,7 +144,7 @@ ZLIB_INTERNAL void cpu_check_features(void)
 }
 
 /* stub functions */
-ZLIB_INTERNAL void insert_string_stub(deflate_state *const s, const uint32_t str, uint32_t count) {
+Z_INTERNAL void insert_string_stub(deflate_state *const s, const uint32_t str, uint32_t count) {
     // Initialize default
 
     functable.insert_string = &insert_string_c;
@@ -161,7 +161,7 @@ ZLIB_INTERNAL void insert_string_stub(deflate_state *const s, const uint32_t str
     functable.insert_string(s, str, count);
 }
 
-ZLIB_INTERNAL Pos quick_insert_string_stub(deflate_state *const s, const uint32_t str) {
+Z_INTERNAL Pos quick_insert_string_stub(deflate_state *const s, const uint32_t str) {
     functable.quick_insert_string = &quick_insert_string_c;
 
 #ifdef X86_SSE42_CRC_HASH
@@ -175,7 +175,7 @@ ZLIB_INTERNAL Pos quick_insert_string_stub(deflate_state *const s, const uint32_
     return functable.quick_insert_string(s, str);
 }
 
-ZLIB_INTERNAL void slide_hash_stub(deflate_state *s) {
+Z_INTERNAL void slide_hash_stub(deflate_state *s) {
 
     functable.slide_hash = &slide_hash_c;
     cpu_check_features();
@@ -203,7 +203,7 @@ ZLIB_INTERNAL void slide_hash_stub(deflate_state *s) {
     functable.slide_hash(s);
 }
 
-ZLIB_INTERNAL uint32_t adler32_stub(uint32_t adler, const unsigned char *buf, size_t len) {
+Z_INTERNAL uint32_t adler32_stub(uint32_t adler, const unsigned char *buf, size_t len) {
     // Initialize default
     functable.adler32 = &adler32_c;
     cpu_check_features();
@@ -230,7 +230,7 @@ ZLIB_INTERNAL uint32_t adler32_stub(uint32_t adler, const unsigned char *buf, si
     return functable.adler32(adler, buf, len);
 }
 
-ZLIB_INTERNAL uint32_t chunksize_stub(void) {
+Z_INTERNAL uint32_t chunksize_stub(void) {
     // Initialize default
     functable.chunksize = &chunksize_c;
 
@@ -248,7 +248,7 @@ ZLIB_INTERNAL uint32_t chunksize_stub(void) {
     return functable.chunksize();
 }
 
-ZLIB_INTERNAL uint8_t* chunkcopy_stub(uint8_t *out, uint8_t const *from, unsigned len) {
+Z_INTERNAL uint8_t* chunkcopy_stub(uint8_t *out, uint8_t const *from, unsigned len) {
     // Initialize default
     functable.chunkcopy = &chunkcopy_c;
 
@@ -266,7 +266,7 @@ ZLIB_INTERNAL uint8_t* chunkcopy_stub(uint8_t *out, uint8_t const *from, unsigne
     return functable.chunkcopy(out, from, len);
 }
 
-ZLIB_INTERNAL uint8_t* chunkcopy_safe_stub(uint8_t *out, uint8_t const *from, unsigned len, uint8_t *safe) {
+Z_INTERNAL uint8_t* chunkcopy_safe_stub(uint8_t *out, uint8_t const *from, unsigned len, uint8_t *safe) {
     // Initialize default
     functable.chunkcopy_safe = &chunkcopy_safe_c;
 
@@ -284,7 +284,7 @@ ZLIB_INTERNAL uint8_t* chunkcopy_safe_stub(uint8_t *out, uint8_t const *from, un
     return functable.chunkcopy_safe(out, from, len, safe);
 }
 
-ZLIB_INTERNAL uint8_t* chunkunroll_stub(uint8_t *out, unsigned *dist, unsigned *len) {
+Z_INTERNAL uint8_t* chunkunroll_stub(uint8_t *out, unsigned *dist, unsigned *len) {
     // Initialize default
     functable.chunkunroll = &chunkunroll_c;
 
@@ -302,7 +302,7 @@ ZLIB_INTERNAL uint8_t* chunkunroll_stub(uint8_t *out, unsigned *dist, unsigned *
     return functable.chunkunroll(out, dist, len);
 }
 
-ZLIB_INTERNAL uint8_t* chunkmemset_stub(uint8_t *out, unsigned dist, unsigned len) {
+Z_INTERNAL uint8_t* chunkmemset_stub(uint8_t *out, unsigned dist, unsigned len) {
     // Initialize default
     functable.chunkmemset = &chunkmemset_c;
 
@@ -320,7 +320,7 @@ ZLIB_INTERNAL uint8_t* chunkmemset_stub(uint8_t *out, unsigned dist, unsigned le
     return functable.chunkmemset(out, dist, len);
 }
 
-ZLIB_INTERNAL uint8_t* chunkmemset_safe_stub(uint8_t *out, unsigned dist, unsigned len, unsigned left) {
+Z_INTERNAL uint8_t* chunkmemset_safe_stub(uint8_t *out, unsigned dist, unsigned len, unsigned left) {
     // Initialize default
     functable.chunkmemset_safe = &chunkmemset_safe_c;
 
@@ -338,7 +338,7 @@ ZLIB_INTERNAL uint8_t* chunkmemset_safe_stub(uint8_t *out, unsigned dist, unsign
     return functable.chunkmemset_safe(out, dist, len, left);
 }
 
-ZLIB_INTERNAL uint32_t crc32_stub(uint32_t crc, const unsigned char *buf, uint64_t len) {
+Z_INTERNAL uint32_t crc32_stub(uint32_t crc, const unsigned char *buf, uint64_t len) {
 
     Assert(sizeof(uint64_t) >= sizeof(size_t),
            "crc32_z takes size_t but internally we have a uint64_t len");
@@ -365,7 +365,7 @@ ZLIB_INTERNAL uint32_t crc32_stub(uint32_t crc, const unsigned char *buf, uint64
     return functable.crc32(crc, buf, len);
 }
 
-ZLIB_INTERNAL int32_t compare258_stub(const unsigned char *src0, const unsigned char *src1) {
+Z_INTERNAL int32_t compare258_stub(const unsigned char *src0, const unsigned char *src1) {
 
     functable.compare258 = &compare258_c;
 
@@ -390,7 +390,7 @@ ZLIB_INTERNAL int32_t compare258_stub(const unsigned char *src0, const unsigned
     return functable.compare258(src0, src1);
 }
 
-ZLIB_INTERNAL int32_t longest_match_stub(deflate_state *const s, Pos cur_match) {
+Z_INTERNAL int32_t longest_match_stub(deflate_state *const s, Pos cur_match) {
 
     functable.longest_match = &longest_match_c;
 
@@ -416,7 +416,7 @@ ZLIB_INTERNAL int32_t longest_match_stub(deflate_state *const s, Pos cur_match)
 }
 
 /* functable init */
-ZLIB_INTERNAL Z_TLS struct functable_s functable = {
+Z_INTERNAL Z_TLS struct functable_s functable = {
     insert_string_stub,
     quick_insert_string_stub,
     adler32_stub,
index 694206168507ffc724c89faf2c371c879ab4eb08..22e62d4fb82179081965b52dcc940525bb3362cf 100644 (file)
@@ -24,6 +24,6 @@ struct functable_s {
     uint8_t* (* chunkmemset_safe)   (uint8_t *out, unsigned dist, unsigned len, unsigned left);
 };
 
-ZLIB_INTERNAL extern Z_TLS struct functable_s functable;
+Z_INTERNAL extern Z_TLS struct functable_s functable;
 
 #endif
index 0bdc12bfbdeda1a6cf66857034effbc55fca7fc8..16029607f7c4981360b09dae59f4a392548f741c 100644 (file)
--- a/gzguts.h
+++ b/gzguts.h
 #endif
 
 #if defined(HAVE_VISIBILITY_INTERNAL)
-#  define ZLIB_INTERNAL __attribute__((visibility ("internal")))
+#  define Z_INTERNAL __attribute__((visibility ("internal")))
 #elif defined(HAVE_VISIBILITY_HIDDEN)
-#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#  define Z_INTERNAL __attribute__((visibility ("hidden")))
 #else
-#  define ZLIB_INTERNAL
+#  define Z_INTERNAL
 #endif
 
 #include <stdio.h>
@@ -139,7 +139,7 @@ typedef struct {
 typedef gz_state *gz_statep;
 
 /* shared functions */
-void ZLIB_INTERNAL gz_error(gz_state *, int, const char *);
+void Z_INTERNAL gz_error(gz_state *, int, const char *);
 
 /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
    value -- needed when comparing unsigned to z_off64_t, which is signed
@@ -147,7 +147,7 @@ void ZLIB_INTERNAL gz_error(gz_state *, int, const char *);
 #ifdef INT_MAX
 #  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
 #else
-unsigned ZLIB_INTERNAL gz_intmax(void);
+unsigned Z_INTERNAL gz_intmax(void);
 #  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
 #endif
 
diff --git a/gzlib.c b/gzlib.c
index cef3606f0cba4c6308f08893bf11a8ecca51a125..ebb3751810fc399eafc62fac91930d0d453e47f5 100644 (file)
--- a/gzlib.c
+++ b/gzlib.c
@@ -480,7 +480,7 @@ void ZEXPORT PREFIX(gzclearerr)(gzFile file) {
    memory).  Simply save the error message as a static string.  If there is an
    allocation failure constructing the error message, then convert the error to
    out of memory. */
-void ZLIB_INTERNAL gz_error(gz_state *state, int err, const char *msg) {
+void Z_INTERNAL gz_error(gz_state *state, int err, const char *msg) {
     /* free previously allocated message and clear */
     if (state->msg != NULL) {
         if (state->err != Z_MEM_ERROR)
@@ -514,7 +514,7 @@ void ZLIB_INTERNAL gz_error(gz_state *state, int err, const char *msg) {
    available) -- we need to do this to cover cases where 2's complement not
    used, since C standard permits 1's complement and sign-bit representations,
    otherwise we could just use ((unsigned)-1) >> 1 */
-unsigned ZLIB_INTERNAL gz_intmax() {
+unsigned Z_INTERNAL gz_intmax() {
     unsigned p, q;
 
     p = 1;
index dd904a4870cd0390813c765c2a6e3ae2cfb1fab5..c3673d7b8cdb9fe4dc13be8f421be4817629368a 100644 (file)
--- a/inffast.c
+++ b/inffast.c
@@ -62,7 +62,7 @@ static inline uint64_t load_64_bits(const unsigned char *in, unsigned bits) {
       requires strm->avail_out >= 258 for each loop to avoid checking for
       output space.
  */
-void ZLIB_INTERNAL zng_inflate_fast(PREFIX3(stream) *strm, unsigned long start) {
+void Z_INTERNAL zng_inflate_fast(PREFIX3(stream) *strm, unsigned long start) {
     /* start: inflate()'s starting value for strm->avail_out */
     struct inflate_state *state;
     z_const unsigned char *in;  /* local strm->next_in */
index 94ffc2fc98e33125596cc49b67ca295ae4da99c6..179a65da6019ad2c46af2b9a3353e0c41042c500 100644 (file)
--- a/inffast.h
+++ b/inffast.h
@@ -10,7 +10,7 @@
    subject to change. Applications should only use zlib.h.
  */
 
-void ZLIB_INTERNAL zng_inflate_fast(PREFIX3(stream) *strm, unsigned long start);
+void Z_INTERNAL zng_inflate_fast(PREFIX3(stream) *strm, unsigned long start);
 
 #define INFLATE_FAST_MIN_HAVE 8
 #define INFLATE_FAST_MIN_LEFT 258
index 7211bf8d555708b3e6acf3447bb80191df5902b8..717e1cfc351b193a783c6171cc6c88b6616e2526 100644 (file)
--- a/inflate.c
+++ b/inflate.c
@@ -193,14 +193,14 @@ int32_t ZEXPORT PREFIX(inflatePrime)(PREFIX3(stream) *strm, int32_t bits, int32_
    fixed code decoding.  This returns fixed tables from inffixed_tbl.h.
  */
 
-void ZLIB_INTERNAL fixedtables(struct inflate_state *state) {
+void Z_INTERNAL fixedtables(struct inflate_state *state) {
     state->lencode = lenfix;
     state->lenbits = 9;
     state->distcode = distfix;
     state->distbits = 5;
 }
 
-int ZLIB_INTERNAL inflate_ensure_window(struct inflate_state *state) {
+int Z_INTERNAL inflate_ensure_window(struct inflate_state *state) {
     /* if it hasn't been done already, allocate space for the window */
     if (state->window == NULL) {
         unsigned wsize = 1U << state->wbits;
index d9dda7902952da5395866930b425667c69f9daca..aa8a42a085432290890b6cb014b25dc58a14d970 100644 (file)
--- a/inflate.h
+++ b/inflate.h
@@ -129,7 +129,7 @@ struct inflate_state {
     uint32_t chunksize;         /* size of memory copying chunk */
 };
 
-int ZLIB_INTERNAL inflate_ensure_window(struct inflate_state *state);
-void ZLIB_INTERNAL fixedtables(struct inflate_state *state);
+int Z_INTERNAL inflate_ensure_window(struct inflate_state *state);
+void Z_INTERNAL fixedtables(struct inflate_state *state);
 
 #endif /* INFLATE_H_ */
index f19b83a0286cc2ab947df49ee5a7e1eb9182ac17..c576b5fb1099821d7b60bc8e72b73e21b4ca0cb8 100644 (file)
@@ -29,7 +29,7 @@ const char PREFIX(inflate_copyright)[] = " inflate 1.2.12.f Copyright 1995-2016
    table index bits.  It will differ if the request is greater than the
    longest code or if it is less than the shortest code.
  */
-int ZLIB_INTERNAL zng_inflate_table(codetype type, uint16_t *lens, unsigned codes,
+int Z_INTERNAL zng_inflate_table(codetype type, uint16_t *lens, unsigned codes,
                                 code * *table, unsigned *bits, uint16_t *work) {
     unsigned len;               /* a code's length in bits */
     unsigned sym;               /* index of code symbols */
index 8395e764e312704fadb6725714810450d1f54eb7..7758737c2e9236ac853816b959464c2e61108474 100644 (file)
@@ -60,7 +60,7 @@ typedef enum {
     DISTS
 } codetype;
 
-int ZLIB_INTERNAL zng_inflate_table (codetype type, uint16_t *lens, unsigned codes,
+int Z_INTERNAL zng_inflate_table (codetype type, uint16_t *lens, unsigned codes,
                                   code * *table, unsigned *bits, uint16_t *work);
 
 #endif /* INFTREES_H_ */
index 17a42b2d3970a754854bf3279d197d254a14cab2..653bb96c0dfe01142d8ea318f5a57913fcf0d0fa 100644 (file)
@@ -27,7 +27,7 @@
  * of the hash chain (the most recent string with same hash key). Return
  * the previous length of the hash chain.
  */
-ZLIB_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const uint32_t str) {
+Z_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const uint32_t str) {
     Pos head;
     uint8_t *strstart = s->window + str;
     uint32_t val, hm, h = 0;
@@ -60,7 +60,7 @@ ZLIB_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const uint32_t str
  *    input characters and the first MIN_MATCH bytes of str are valid
  *    (except for the last MIN_MATCH-1 bytes of the input file).
  */
-ZLIB_INTERNAL void INSERT_STRING(deflate_state *const s, const uint32_t str, uint32_t count) {
+Z_INTERNAL void INSERT_STRING(deflate_state *const s, const uint32_t str, uint32_t count) {
     uint8_t *strstart = s->window + str;
     uint8_t *strend = strstart + count - 1; /* last position */
 
index 306f9a070ceb52cfde96dbd8c520ddf04886c986..12da39f449d3280b9c8f34e056fb2bec09f9b92f 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
  */
-ZLIB_INTERNAL int32_t LONGEST_MATCH(deflate_state *const s, Pos cur_match) {
+Z_INTERNAL int32_t LONGEST_MATCH(deflate_state *const s, Pos cur_match) {
     unsigned int strstart = s->strstart;
     const unsigned wmask = s->w_mask;
     unsigned char *window = s->window;
index 4cc89a456c978b558f0ad270102a915b38eb77cc..6a7d061a0269d4dfd65a5e1415cc75aa59442e6e 100644 (file)
@@ -5,7 +5,7 @@
 #include "inflate.h"
 
 // Build and return state with length and distance decoding tables and index sizes set to fixed code decoding.
-void ZLIB_INTERNAL buildfixedtables(struct inflate_state *state) {
+void Z_INTERNAL buildfixedtables(struct inflate_state *state) {
     static code *lenfix, *distfix;
     static code fixed[544];
 
index 00b7c833d1b93502d558e359635070fcae68d8c5..337f2fc070dd704ebf47f50caa7cf7773a56d3f1 100644 (file)
@@ -106,32 +106,32 @@ static void gen_trees_header() {
 
     printf("/* header created automatically with maketrees.c */\n\n");
 
-    printf("ZLIB_INTERNAL const ct_data static_ltree[L_CODES+2] = {\n");
+    printf("Z_INTERNAL const ct_data static_ltree[L_CODES+2] = {\n");
     for (i = 0; i < L_CODES+2; i++) {
         printf("{{%3u},{%u}}%s", static_ltree[i].Code, static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
     }
 
-    printf("ZLIB_INTERNAL const ct_data static_dtree[D_CODES] = {\n");
+    printf("Z_INTERNAL const ct_data static_dtree[D_CODES] = {\n");
     for (i = 0; i < D_CODES; i++) {
         printf("{{%2u},{%u}}%s", static_dtree[i].Code, static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
     }
 
-    printf("const unsigned char ZLIB_INTERNAL zng_dist_code[DIST_CODE_LEN] = {\n");
+    printf("const unsigned char Z_INTERNAL zng_dist_code[DIST_CODE_LEN] = {\n");
     for (i = 0; i < DIST_CODE_LEN; i++) {
         printf("%2u%s", dist_code[i], SEPARATOR(i, DIST_CODE_LEN-1, 20));
     }
 
-    printf("const unsigned char ZLIB_INTERNAL zng_length_code[MAX_MATCH-MIN_MATCH+1] = {\n");
+    printf("const unsigned char Z_INTERNAL zng_length_code[MAX_MATCH-MIN_MATCH+1] = {\n");
     for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
         printf("%2u%s", length_code[i], SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
     }
 
-    printf("ZLIB_INTERNAL const int base_length[LENGTH_CODES] = {\n");
+    printf("Z_INTERNAL const int base_length[LENGTH_CODES] = {\n");
     for (i = 0; i < LENGTH_CODES; i++) {
         printf("%d%s", base_length[i], SEPARATOR(i, LENGTH_CODES-1, 20));
     }
 
-    printf("ZLIB_INTERNAL const int base_dist[D_CODES] = {\n");
+    printf("Z_INTERNAL const int base_dist[D_CODES] = {\n");
     for (i = 0; i < D_CODES; i++) {
         printf("%5d%s", base_dist[i], SEPARATOR(i, D_CODES-1, 10));
     }
diff --git a/trees.c b/trees.c
index e7a9fcf05f6e4bc3791fe5666aaaed77343b250a..6a4362b04a497079d4bc829da2a933ce6ccf7aac 100644 (file)
--- a/trees.c
+++ b/trees.c
@@ -80,7 +80,7 @@ static void bi_flush         (deflate_state *s);
 /* ===========================================================================
  * Initialize the tree data structures for a new zlib stream.
  */
-void ZLIB_INTERNAL zng_tr_init(deflate_state *s) {
+void Z_INTERNAL zng_tr_init(deflate_state *s) {
     s->l_desc.dyn_tree = s->dyn_ltree;
     s->l_desc.stat_desc = &static_l_desc;
 
@@ -278,7 +278,7 @@ static void gen_bitlen(deflate_state *s, tree_desc *desc) {
  * OUT assertion: the field code is set for all tree elements of non
  *     zero code length.
  */
-ZLIB_INTERNAL void gen_codes(ct_data *tree, int max_code, uint16_t *bl_count) {
+Z_INTERNAL void gen_codes(ct_data *tree, int max_code, uint16_t *bl_count) {
     /* tree: the tree to decorate */
     /* max_code: largest code with non zero frequency */
     /* bl_count: number of codes at each bit length */
@@ -589,7 +589,7 @@ static void send_all_trees(deflate_state *s, int lcodes, int dcodes, int blcodes
 /* ===========================================================================
  * Send a stored block
  */
-void ZLIB_INTERNAL zng_tr_stored_block(deflate_state *s, char *buf, uint32_t stored_len, int last) {
+void Z_INTERNAL zng_tr_stored_block(deflate_state *s, char *buf, uint32_t stored_len, int last) {
     /* buf: input block */
     /* stored_len: length of input block */
     /* last: one if this is the last block for a file */
@@ -611,7 +611,7 @@ void ZLIB_INTERNAL zng_tr_stored_block(deflate_state *s, char *buf, uint32_t sto
 /* ===========================================================================
  * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)
  */
-void ZLIB_INTERNAL zng_tr_flush_bits(deflate_state *s) {
+void Z_INTERNAL zng_tr_flush_bits(deflate_state *s) {
     bi_flush(s);
 }
 
@@ -619,7 +619,7 @@ void ZLIB_INTERNAL zng_tr_flush_bits(deflate_state *s) {
  * Send one empty static block to give enough lookahead for inflate.
  * This takes 10 bits, of which 7 may remain in the bit buffer.
  */
-void ZLIB_INTERNAL zng_tr_align(deflate_state *s) {
+void Z_INTERNAL zng_tr_align(deflate_state *s) {
     zng_tr_emit_tree(s, STATIC_TREES, 0);
     zng_tr_emit_end_block(s, static_ltree, 0);
     bi_flush(s);
@@ -629,7 +629,7 @@ void ZLIB_INTERNAL zng_tr_align(deflate_state *s) {
  * Determine the best encoding for the current block: dynamic trees, static
  * trees or store, and write out the encoded block.
  */
-void ZLIB_INTERNAL zng_tr_flush_block(deflate_state *s, char *buf, uint32_t stored_len, int last) {
+void Z_INTERNAL zng_tr_flush_block(deflate_state *s, char *buf, uint32_t stored_len, int last) {
     /* buf: input block, or NULL if too old */
     /* stored_len: length of input block */
     /* last: one if this is the last block for a file */
@@ -813,7 +813,7 @@ static void bi_flush(deflate_state *s) {
  * method would use a table)
  * IN assertion: 1 <= len <= 15
  */
-ZLIB_INTERNAL unsigned bi_reverse(unsigned code, int len) {
+Z_INTERNAL unsigned bi_reverse(unsigned code, int len) {
     /* code: the value to invert */
     /* len: its bit length */
     Z_REGISTER unsigned res = 0;
index 452fad6c71bf3d499413eb5bea70a30220ea9dba..118dbb2d8fd6fbaa01d974aca13c103caa0d21d6 100644 (file)
 
 
 /* trees.h */
-extern ZLIB_INTERNAL const ct_data static_ltree[L_CODES+2];
-extern ZLIB_INTERNAL const ct_data static_dtree[D_CODES];
+extern Z_INTERNAL const ct_data static_ltree[L_CODES+2];
+extern Z_INTERNAL const ct_data static_dtree[D_CODES];
 
-extern const unsigned char ZLIB_INTERNAL zng_dist_code[DIST_CODE_LEN];
-extern const unsigned char ZLIB_INTERNAL zng_length_code[MAX_MATCH-MIN_MATCH+1];
+extern const unsigned char Z_INTERNAL zng_dist_code[DIST_CODE_LEN];
+extern const unsigned char Z_INTERNAL zng_length_code[MAX_MATCH-MIN_MATCH+1];
 
-extern ZLIB_INTERNAL const int base_length[LENGTH_CODES];
-extern ZLIB_INTERNAL const int base_dist[D_CODES];
+extern Z_INTERNAL const int base_length[LENGTH_CODES];
+extern Z_INTERNAL const int base_dist[D_CODES];
 
 /* Bit buffer and deflate code stderr tracing */
 #ifdef ZLIB_DEBUG
@@ -32,7 +32,7 @@ extern ZLIB_INTERNAL const int base_dist[D_CODES];
         fprintf(stderr, "\ncd %3d ", (c)); \
     }
 #else
-#  define send_bits_trace(s, value, length) 
+#  define send_bits_trace(s, value, length)
 #  define send_code_trace(s, c)
 #endif
 
@@ -117,7 +117,7 @@ static inline uint32_t zng_emit_lit(deflate_state *s, const ct_data *ltree, unsi
 /* ===========================================================================
  * Emit match distance/length code
  */
-static inline uint32_t zng_emit_dist(deflate_state *s, const ct_data *ltree, const ct_data *dtree, 
+static inline uint32_t zng_emit_dist(deflate_state *s, const ct_data *ltree, const ct_data *dtree,
     uint32_t lc, uint32_t dist) {
     uint32_t c, extra;
     uint8_t code;
@@ -188,7 +188,7 @@ static inline void zng_tr_emit_lit(deflate_state *s, const ct_data *ltree, unsig
 /* ===========================================================================
  * Emit match and count bits
  */
-static inline void zng_tr_emit_dist(deflate_state *s, const ct_data *ltree, const ct_data *dtree, 
+static inline void zng_tr_emit_dist(deflate_state *s, const ct_data *ltree, const ct_data *dtree,
     uint32_t lc, uint32_t dist) {
     cmpr_bits_add(s, zng_emit_dist(s, ltree, dtree, lc, dist));
 }
@@ -205,7 +205,7 @@ static inline void zng_tr_emit_tree(deflate_state *s, int type, const int last)
     s->bi_valid = bi_valid;
     s->bi_buf = bi_buf;
     Tracev((stderr, "\n--- Emit Tree: Last: %u\n", last));
-} 
+}
 
 /* ===========================================================================
  * Align bit buffer on a byte boundary and count bits
index 7c968361daa2779be3898e7f892ec072ad0c01b0..a4c68a56651cd5b0d0198bbd86a19534bd7c27ac 100644 (file)
@@ -3,7 +3,7 @@
 
 /* header created automatically with maketrees.c */
 
-ZLIB_INTERNAL const ct_data static_ltree[L_CODES+2] = {
+Z_INTERNAL const ct_data static_ltree[L_CODES+2] = {
 {{ 12},{8}}, {{140},{8}}, {{ 76},{8}}, {{204},{8}}, {{ 44},{8}},
 {{172},{8}}, {{108},{8}}, {{236},{8}}, {{ 28},{8}}, {{156},{8}},
 {{ 92},{8}}, {{220},{8}}, {{ 60},{8}}, {{188},{8}}, {{124},{8}},
@@ -64,7 +64,7 @@ ZLIB_INTERNAL const ct_data static_ltree[L_CODES+2] = {
 {{163},{8}}, {{ 99},{8}}, {{227},{8}}
 };
 
-ZLIB_INTERNAL const ct_data static_dtree[D_CODES] = {
+Z_INTERNAL const ct_data static_dtree[D_CODES] = {
 {{ 0},{5}}, {{16},{5}}, {{ 8},{5}}, {{24},{5}}, {{ 4},{5}},
 {{20},{5}}, {{12},{5}}, {{28},{5}}, {{ 2},{5}}, {{18},{5}},
 {{10},{5}}, {{26},{5}}, {{ 6},{5}}, {{22},{5}}, {{14},{5}},
@@ -73,7 +73,7 @@ ZLIB_INTERNAL const ct_data static_dtree[D_CODES] = {
 {{19},{5}}, {{11},{5}}, {{27},{5}}, {{ 7},{5}}, {{23},{5}}
 };
 
-const unsigned char ZLIB_INTERNAL zng_dist_code[DIST_CODE_LEN] = {
+const unsigned char Z_INTERNAL zng_dist_code[DIST_CODE_LEN] = {
  0,  1,  2,  3,  4,  4,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,
  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10, 10,
 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
@@ -102,7 +102,7 @@ const unsigned char ZLIB_INTERNAL zng_dist_code[DIST_CODE_LEN] = {
 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
 };
 
-const unsigned char ZLIB_INTERNAL zng_length_code[MAX_MATCH-MIN_MATCH+1] = {
+const unsigned char Z_INTERNAL zng_length_code[MAX_MATCH-MIN_MATCH+1] = {
  0,  1,  2,  3,  4,  5,  6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 12, 12,
 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
@@ -118,12 +118,12 @@ const unsigned char ZLIB_INTERNAL zng_length_code[MAX_MATCH-MIN_MATCH+1] = {
 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
 };
 
-ZLIB_INTERNAL const int base_length[LENGTH_CODES] = {
+Z_INTERNAL const int base_length[LENGTH_CODES] = {
 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
 64, 80, 96, 112, 128, 160, 192, 224, 0
 };
 
-ZLIB_INTERNAL const int base_dist[D_CODES] = {
+Z_INTERNAL const int base_dist[D_CODES] = {
     0,     1,     2,     3,     4,     6,     8,    12,    16,    24,
    32,    48,    64,    96,   128,   192,   256,   384,   512,   768,
  1024,  1536,  2048,  3072,  4096,  6144,  8192, 12288, 16384, 24576
index 1934ba3f5dfb2d901c8646a53e5aca5cd004e9d3..54ce3f7ada6de33af66f41519608131b4ba27ba0 100644 (file)
--- a/uncompr.c
+++ b/uncompr.c
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
-#define ZLIB_INTERNAL
+#define Z_INTERNAL
 #include "zbuild.h"
 #ifdef ZLIB_COMPAT
 #  include "zlib.h"
index 6f1abdb3f3e236dd7fc630f59ef3701adf5f3006..8588ec89c383bd0844a1a64705d6f4d48c18472e 100644 (file)
 
 /* Type declarations */
 
+#ifdef ZLIB_INTERNAL
+#  define Z_INTERNAL ZLIB_INTERNAL
+#endif
 
 /* If building or using zlib as a DLL, define ZLIB_DLL.
  * This is not mandatory, but it offers a little performance increase.
  */
 #if defined(ZLIB_DLL) && (defined(_WIN32) || (__has_declspec_attribute(dllexport) && __has_declspec_attribute(dllimport)))
-#  ifdef ZLIB_INTERNAL
+#  ifdef Z_INTERNAL
 #    define ZEXTERN extern __declspec(dllexport)
 #  else
 #    define ZEXTERN extern __declspec(dllimport)
index 6ff48c07dc8bcf32e472906441ae986061c681ab..24f57dc3736d40a7062abc94e0b8379b28b498a0 100644 (file)
 #  define OF(args)  args
 #endif
 
+#ifdef ZLIB_INTERNAL
+#  define Z_INTERNAL ZLIB_INTERNAL
+#endif
+
 /* If building or using zlib as a DLL, define ZLIB_DLL.
  * This is not mandatory, but it offers a little performance increase.
  */
 #if defined(ZLIB_DLL) && (defined(_WIN32) || (__has_declspec_attribute(dllexport) && __has_declspec_attribute(dllimport)))
-#  ifdef ZLIB_INTERNAL
+#  ifdef Z_INTERNAL
 #    define ZEXTERN extern __declspec(dllexport)
 #  else
 #    define ZEXTERN extern __declspec(dllimport)
diff --git a/zutil.c b/zutil.c
index fc1b96a552eb8bd8fa25b291bd4cbe4f4e94ae95..08cf2aea1fb19ea55334cec183d43dcff7c210ea 100644 (file)
--- a/zutil.c
+++ b/zutil.c
@@ -87,9 +87,9 @@ unsigned long ZEXPORT PREFIX(zlibCompileFlags)(void) {
 #  ifndef verbose
 #    define verbose 0
 #  endif
-int ZLIB_INTERNAL z_verbose = verbose;
+int Z_INTERNAL z_verbose = verbose;
 
-void ZLIB_INTERNAL z_error(char *m) {
+void Z_INTERNAL z_error(char *m) {
     fprintf(stderr, "%s\n", m);
     exit(1);
 }
@@ -115,7 +115,7 @@ const char * ZEXPORT PREFIX(zError)(int err) {
 #  endif
 #endif
 
-void ZLIB_INTERNAL *zng_calloc(void *opaque, unsigned items, unsigned size)
+void Z_INTERNAL *zng_calloc(void *opaque, unsigned items, unsigned size)
 {
     (void)opaque;
 #ifndef UNALIGNED_OK
@@ -126,7 +126,7 @@ void ZLIB_INTERNAL *zng_calloc(void *opaque, unsigned items, unsigned size)
 #endif
 }
 
-void ZLIB_INTERNAL zng_cfree(void *opaque, void *ptr) {
+void Z_INTERNAL zng_cfree(void *opaque, void *ptr) {
     (void)opaque;
 #ifndef UNALIGNED_OK
     zng_align_free(ptr);
diff --git a/zutil.h b/zutil.h
index 647e2d40b1571c06ee5b6d18f90e46e1434813d0..4c639414a0a0e3e8db0af9b01935b5443b96f5c9 100644 (file)
--- a/zutil.h
+++ b/zutil.h
  */
 
 #if defined(HAVE_VISIBILITY_INTERNAL)
-#  define ZLIB_INTERNAL __attribute__((visibility ("internal")))
+#  define Z_INTERNAL __attribute__((visibility ("internal")))
 #elif defined(HAVE_VISIBILITY_HIDDEN)
-#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#  define Z_INTERNAL __attribute__((visibility ("hidden")))
 #else
-#  define ZLIB_INTERNAL
+#  define Z_INTERNAL
 #endif
 
 #ifndef __cplusplus
@@ -146,8 +146,8 @@ extern z_const char * const PREFIX(z_errmsg)[10]; /* indexed by 2-zlib_error */
 /* Diagnostic functions */
 #ifdef ZLIB_DEBUG
 #  include <stdio.h>
-   extern int ZLIB_INTERNAL z_verbose;
-   extern void ZLIB_INTERNAL z_error(char *m);
+   extern int Z_INTERNAL z_verbose;
+   extern void Z_INTERNAL z_error(char *m);
 #  define Assert(cond, msg) {if (!(cond)) z_error(msg);}
 #  define Trace(x) {if (z_verbose >= 0) fprintf x;}
 #  define Tracev(x) {if (z_verbose > 0) fprintf x;}
@@ -163,8 +163,8 @@ extern z_const char * const PREFIX(z_errmsg)[10]; /* indexed by 2-zlib_error */
 #  define Tracecv(c, x)
 #endif
 
-void ZLIB_INTERNAL *zng_calloc(void *opaque, unsigned items, unsigned size);
-void ZLIB_INTERNAL   zng_cfree(void *opaque, void *ptr);
+void Z_INTERNAL *zng_calloc(void *opaque, unsigned items, unsigned size);
+void Z_INTERNAL   zng_cfree(void *opaque, void *ptr);
 
 #define ZALLOC(strm, items, size) (*((strm)->zalloc))((strm)->opaque, (items), (size))
 #define ZFREE(strm, addr)         (*((strm)->zfree))((strm)->opaque, (void *)(addr))