summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2019-01-05 18:40:18 +0100
committerJulian Andres Klode <jak@debian.org>2019-01-05 18:40:18 +0100
commitfb1c5167f1a69fc47ca8e741b86fab1ae7c08309 (patch)
tree35f1e87d16b6f75ff29c1f0dcfedb69a048f8bca /apt-pkg
parentd87d15beb103a20728348a0f4a4cedec8192ea6d (diff)
hash32: Tighten to multiversion to x86-64 ELF and use uint32_t
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/pkgcache.cc6
1 files changed, 3 insertions, 3 deletions
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);
}