IMPORT: slz: silence a build warning on non-x86 non-arm

Building with clang 16 on MIPS64 yields this warning:

  src/slz.c:931:24: warning: unused function 'crc32_uint32' [-Wunused-function]
  static inline uint32_t crc32_uint32(uint32_t data)
                         ^

Let's guard it using UNALIGNED_LE_OK which is the only case where it's
used. This saves us from introducing a possibly non-portable attribute.

This is libslz upstream commit f5727531dba8906842cb91a75c1ffa85685a6421.
This commit is contained in:
Willy Tarreau 2025-05-16 16:19:04 +02:00
parent 31ca29eee1
commit ccc65012d3

View File

@ -937,6 +937,7 @@ static inline uint32_t crc32_char(uint32_t crc, uint8_t x)
return crc; return crc;
} }
#ifdef UNALIGNED_LE_OK
static inline uint32_t crc32_uint32(uint32_t data) static inline uint32_t crc32_uint32(uint32_t data)
{ {
#if defined(__ARM_FEATURE_CRC32) #if defined(__ARM_FEATURE_CRC32)
@ -956,6 +957,7 @@ static inline uint32_t crc32_uint32(uint32_t data)
#endif #endif
return data; return data;
} }
#endif
/* Modified version originally from RFC1952, working with non-inverting CRCs */ /* Modified version originally from RFC1952, working with non-inverting CRCs */
uint32_t slz_crc32_by1(uint32_t crc, const unsigned char *buf, int len) uint32_t slz_crc32_by1(uint32_t crc, const unsigned char *buf, int len)