summaryrefslogtreecommitdiff
path: root/hash.h
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-01-23 22:16:36 +0000
committerdormando <dormando@rydia.net>2020-02-01 14:36:23 -0800
commit0447ae4cbbebb87d3f28bb92f7e219a47263b889 (patch)
tree743e05662e517a1979a732f0fded41239e46a759 /hash.h
parent32bf2c3668a9ebed1374190bbefe9b783928f0ba (diff)
downloadmemcached-0447ae4cbbebb87d3f28bb92f7e219a47263b889.tar.gz
hash: fix build failure against gcc-10
On gcc-10 (and gcc-9 -fno-common) build fails as: ``` gcc -g -O2 -pthread -pthread -Wall -Werror -pedantic -Wmissing-prototypes \ -Wmissing-declarations -Wredundant-decls -o memcached ... -levent ld: memcached-hash.o:memcached/hash.h:5: multiple definition of `hash'; memcached-memcached.o:memcached/hash.h:5: first defined here ``` gcc-10 will change the default from -fcommon to fno-common: https://gcc.gnu.org/PR85678. The error also happens if CFLAGS=-fno-common passed explicitly. Reported-by: Brian Evans Bug: https://bugs.gentoo.org/706196 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'hash.h')
-rw-r--r--hash.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/hash.h b/hash.h
index 059d1e2..3b2a984 100644
--- a/hash.h
+++ b/hash.h
@@ -2,7 +2,7 @@
#define HASH_H
typedef uint32_t (*hash_func)(const void *key, size_t length);
-hash_func hash;
+extern hash_func hash;
enum hashfunc_type {
JENKINS_HASH=0, MURMUR3_HASH