Skip to content

Commit

Permalink
Remove linux-specific libs
Browse files Browse the repository at this point in the history
  • Loading branch information
josiahcarlson authored and rurban committed May 5, 2024
1 parent 9f7a979 commit a75e2a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 4 additions & 7 deletions crc64.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,9 @@ uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l) {
}


#include <pthread.h>
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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
}
2 changes: 0 additions & 2 deletions crccombine.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include <stdint.h>
#include <stdio.h>
#include <strings.h>
#if defined(__i386__) || defined(__X86_64__)
#include <immintrin.h>
#endif
Expand Down

0 comments on commit a75e2a9

Please sign in to comment.