mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
i HATE ZLIB PART 2
This commit is contained in:
parent
8663fb0a82
commit
26f7249898
2 changed files with 30 additions and 0 deletions
29
modules/zlib/src/crc32_stub.c
Normal file
29
modules/zlib/src/crc32_stub.c
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Minimal CRC folding stubs for builds without CRC SIMD support.
|
||||
|
||||
#include "zutil.h"
|
||||
#include "crc32.h"
|
||||
|
||||
// The folded CRC state type is declared in crc32.h as crc32_fold (or similar).
|
||||
// We don't use any SIMD here; we just fall back to scalar crc32.
|
||||
|
||||
void crc_fold_init(crc32_fold *crc)
|
||||
{
|
||||
// Initialize to standard CRC-32 initial value.
|
||||
crc->crc = 0xffffffffu;
|
||||
}
|
||||
|
||||
void crc_fold_copy(crc32_fold *crc,
|
||||
unsigned char *dst,
|
||||
const unsigned char *src,
|
||||
long len)
|
||||
{
|
||||
// Simple scalar copy + CRC update.
|
||||
memcpy(dst, src, (size_t)len);
|
||||
crc->crc = crc32(crc->crc, src, (uInt)len);
|
||||
}
|
||||
|
||||
uint32_t crc_fold_512to32(crc32_fold *crc)
|
||||
{
|
||||
// Finalize CRC (invert bits as usual).
|
||||
return crc->crc ^ 0xffffffffu;
|
||||
}
|
||||
|
|
@ -38,6 +38,7 @@ if CONFIG['INTEL_ARCHITECTURE']:
|
|||
DEFINES['INFLATE_CHUNK_SIMD_SSE2'] = False
|
||||
DEFINES['CRC32_SIMD_SSE42_PCLMUL'] = False
|
||||
SOURCES += [
|
||||
'crc32_stub.c',
|
||||
'simd_stub.c',
|
||||
]
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue