# include "zbuild.h"
# include "gzendian.h"
+# include <inttypes.h>
/*
Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
}
#ifdef DYNAMIC_CRC_TABLE
-static volatile int crc_table_empty = 1;
+volatile int crc_table_empty = 1;
static uint32_t crc_table[8][256];
static uint32_t crc_comb[GF2_DIM][GF2_DIM];
-static void make_crc_table(void);
+void make_crc_table(void);
static void gf2_matrix_square(uint32_t *square, const uint32_t *mat);
#ifdef MAKECRCH
static void write_table(FILE *, const uint32_t *, int);
allow for word-at-a-time CRC calculation for both big-endian and little-
endian machines, where a word is four bytes.
*/
-static void make_crc_table() {
+void make_crc_table() {
uint32_t c;
int n, k;
uint32_t poly; /* polynomial exclusive-or pattern */
int n;
for (n = 0; n < k; n++)
- fprintf(out, "%s0x%08lx%s", n % 5 ? "" : " ",
+ fprintf(out, "%s0x%08" PRIx32 "%s", n % 5 ? "" : " ",
(uint32_t)(table[n]),
n == k - 1 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
}
ZLIB_INTERNAL uint32_t crc32_generic(uint32_t, const unsigned char *, uint64_t);
+#ifdef DYNAMIC_CRC_TABLE
+extern volatile int crc_table_empty;
+extern void make_crc_table(void);
+#endif
+
#ifdef __ARM_FEATURE_CRC32
extern uint32_t crc32_acle(uint32_t, const unsigned char *, uint64_t);
#endif