summaryrefslogtreecommitdiffstats
path: root/include/fnv_hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/fnv_hash.h')
-rw-r--r--include/fnv_hash.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/fnv_hash.h b/include/fnv_hash.h
index 9d8851bd..837fd66c 100644
--- a/include/fnv_hash.h
+++ b/include/fnv_hash.h
@@ -1,3 +1,5 @@
+#ifndef _FNV_HASH_H_
+#define _FNV_HASH_H_
/*
* Fowler / Noll / Vo Hash (FNV Hash)
* http://www.isthe.com/chongo/tech/comp/fnv/
@@ -105,3 +107,6 @@ fnv1a_64_strcase(const char *str, Fnv64_t hval)
}
return hval;
}
+
+#define FNV1A_CHAR(c,hval) do { hval^=(unsigned char)c; hval*=FNV_32_PRIME; } while(0)
+#endif