From a75e2a9d27444d823cf60211d25d6a3564af1b20 Mon Sep 17 00:00:00 2001 From: Josiah Carlson Date: Sun, 5 May 2024 09:44:51 -0700 Subject: [PATCH] Remove linux-specific libs --- crc64.c | 11 ++++------- crccombine.c | 2 -- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/crc64.c b/crc64.c index 17ce4e44..6a781620 100644 --- a/crc64.c +++ b/crc64.c @@ -141,12 +141,9 @@ uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l) { } -#include -static pthread_once_t crc64_once_init = PTHREAD_ONCE_INIT; - void crc64_jones_test1(const void *input, int len, uint32_t seed, void *out) { - pthread_once(&crc64_once_init, crc64_init); + if (!crc64_table[0][1]) crc64_init(); size_t old1 = get_cutoff(0), old2 = get_cutoff(1); set_crc64_cutoffs(SIZE_MAX, SIZE_MAX); ((uint64_t*)out)[0] = crc64((uint64_t)seed, (const unsigned char*)input, len); @@ -155,7 +152,7 @@ void crc64_jones_test1(const void *input, int len, uint32_t seed, void *out) void crc64_jones_test2(const void *input, int len, uint32_t seed, void *out) { - pthread_once(&crc64_once_init, crc64_init); + if (!crc64_table[0][1]) crc64_init(); size_t old1 = get_cutoff(0), old2 = get_cutoff(1); set_crc64_cutoffs(1, SIZE_MAX); ((uint64_t*)out)[0] = crc64((uint64_t)seed, (const unsigned char*)input, len); @@ -164,7 +161,7 @@ void crc64_jones_test2(const void *input, int len, uint32_t seed, void *out) void crc64_jones_test3(const void *input, int len, uint32_t seed, void *out) { - pthread_once(&crc64_once_init, crc64_init); + if (!crc64_table[0][1]) crc64_init(); size_t old1 = get_cutoff(0), old2 = get_cutoff(1); set_crc64_cutoffs(1, 1); ((uint64_t*)out)[0] = crc64((uint64_t)seed, (const unsigned char*)input, len); @@ -173,6 +170,6 @@ void crc64_jones_test3(const void *input, int len, uint32_t seed, void *out) void crc64_jones_default(const void *input, int len, uint32_t seed, void *out) { - pthread_once(&crc64_once_init, crc64_init); + if (!crc64_table[0][1]) crc64_init(); ((uint64_t*)out)[0] = crc64((uint64_t)seed, (const unsigned char*)input, len); } diff --git a/crccombine.c b/crccombine.c index 4d9a18c6..bf06a3c1 100644 --- a/crccombine.c +++ b/crccombine.c @@ -1,6 +1,4 @@ #include -#include -#include #if defined(__i386__) || defined(__X86_64__) #include #endif