Skip to content
Snippets Groups Projects
Commit 7142aad6 authored by Alexandr Lyapunov's avatar Alexandr Lyapunov
Browse files

fixed bitset index: hash function now builds on 32bit platform

parent 3ecbe5fa
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,11 @@ struct bitset_hash_entry { ...@@ -46,7 +46,11 @@ struct bitset_hash_entry {
#define mh_int_t uint32_t #define mh_int_t uint32_t
#define mh_arg_t int #define mh_arg_t int
#define mh_hash_key(a, arg) ((uint32_t)(((uintptr_t)(a)) >> 33^((uintptr_t)(a)) ^ ((uintptr_t)(a)) << 11)); #if UINTPTR_MAX == 0xffffffff
#define mh_hash_key(a, arg) ((uintptr_t)(a))
#else
#define mh_hash_key(a, arg) ((uint32_t)(((uintptr_t)(a)) >> 33 ^ ((uintptr_t)(a)) ^ ((uintptr_t)(a)) << 11))
#endif
#define mh_hash(a, arg) mh_hash_key((a)->tuple, arg) #define mh_hash(a, arg) mh_hash_key((a)->tuple, arg)
#define mh_cmp(a, b, arg) ((a)->tuple != (b)->tuple) #define mh_cmp(a, b, arg) ((a)->tuple != (b)->tuple)
#define mh_cmp_key(a, b, arg) ((a) != (b)->tuple) #define mh_cmp_key(a, b, arg) ((a) != (b)->tuple)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment