From 121c865082b405eef016e2bb1ebcb7c51e2075ed Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 10 Jul 2019 14:20:43 +0300 Subject: [PATCH] Allow the use of single-precision floating point math. Need to define `kfloat` as `float` and pass `-fsingle-precision-constant` (or similar for other compilers.) --- khash.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/khash.h b/khash.h index f75f3474..1116c699 100644 --- a/khash.h +++ b/khash.h @@ -189,7 +189,11 @@ typedef khint_t khiter_t; #define kfree(P) free(P) #endif -static const double __ac_HASH_UPPER = 0.77; +#ifndef kfloat +typedef double kfloat; +#endif + +static const kfloat __ac_HASH_UPPER = 0.77; #define __KHASH_TYPE(name, khkey_t, khval_t) \ typedef struct kh_##name##_s { \