aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/check/crc32_small.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/liblzma/check/crc32_small.c')
-rw-r--r--src/liblzma/check/crc32_small.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/liblzma/check/crc32_small.c b/src/liblzma/check/crc32_small.c
index 5f8a3286..186966e9 100644
--- a/src/liblzma/check/crc32_small.c
+++ b/src/liblzma/check/crc32_small.c
@@ -16,6 +16,9 @@
uint32_t lzma_crc32_table[1][256];
+#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
+__attribute__((__constructor__))
+#endif
static void
crc32_init(void)
{
@@ -37,18 +40,22 @@ crc32_init(void)
}
+#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
extern void
lzma_crc32_init(void)
{
mythread_once(crc32_init);
return;
}
+#endif
extern LZMA_API(uint32_t)
lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
{
+#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
lzma_crc32_init();
+#endif
crc = ~crc;