From fb1c5167f1a69fc47ca8e741b86fab1ae7c08309 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 5 Jan 2019 18:40:18 +0100 Subject: hash32: Tighten to multiversion to x86-64 ELF and use uint32_t --- apt-pkg/pkgcache.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-pkg/pkgcache.cc') diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 12c116901..041f0b957 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -231,10 +231,10 @@ map_id_t pkgCache::sHash(const char *Str) const return Hash % HeaderP->GetHashTableSize(); } -#if defined(__GNUC__) +#if defined(__GNUC__) && defined(__x86_64__) && defined(__ELF__) #if defined(__x86_64__) -__attribute__((target("sse4.2"))) static int hash32(int crc32, const unsigned char *input, size_t size) +__attribute__((target("sse4.2"))) static uint32_t hash32(uint32_t crc32, const unsigned char *input, size_t size) { if (input == nullptr) return 0; @@ -270,7 +270,7 @@ __attribute__((target("sse4.2"))) static int hash32(int crc32, const unsigned ch __attribute__((target("default"))) #endif -static int hash32(int crc32, const unsigned char *input, size_t size) +static uint32_t hash32(uint32_t crc32, const unsigned char *input, size_t size) { return adler32(crc32, input, size); } -- cgit v1.2.3