table, which is used also by LZ encoder. This was needed
because calling lzma_crc32() and ignoring the result is
a no-op due to lzma_attr_pure.
/// the array two-dimensional.
#ifdef HAVE_SMALL
extern uint32_t lzma_crc32_table[1][256];
+extern void lzma_crc32_init(void);
#else
extern const uint32_t lzma_crc32_table[8][256];
extern const uint64_t lzma_crc64_table[4][256];
}
+extern void
+lzma_crc32_init(void)
+{
+ mythread_once(crc32_init);
+ return;
+}
+
+
extern LZMA_API(uint32_t)
lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
{
- mythread_once(crc32_init);
+ lzma_crc32_init();
crc = ~crc;
#include "lz_encoder.h"
#include "lz_encoder_hash.h"
+#include "check.h"
struct lzma_coder_s {
{
#ifdef HAVE_SMALL
// We need that the CRC32 table has been initialized.
- // This is enough to do it.
- lzma_crc32(NULL, 0, 0);
+ lzma_crc32_init();
#endif
// Allocate and initialize the base data structure.