blob: c20fd2fd6fc84fa439f897bb79a09d73790a913d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
$NetBSD: patch-src_hyperloglog.c,v 1.2 2020/10/27 10:22:34 adam Exp $
Fix the case of the missing llroundl on NetBSD. Patch by Matthias Petermann.
--- src/hyperloglog.c.orig 2020-10-27 07:12:01.000000000 +0000
+++ src/hyperloglog.c
@@ -34,6 +34,16 @@
#include <stdint.h>
#include <math.h>
+#ifdef __NetBSD__
+#include <sys/param.h>
+#if __NetBSD_Version__ < 799007200
+/* llroundl not present in NetBSD libm before 7.99.71 */
+long long int llroundl (long double x) {
+ return (long long int) roundl (x);
+}
+#endif
+#endif
+
/* The Redis HyperLogLog implementation is based on the following ideas:
*
* * The use of a 64 bit hash function as proposed in [1], in order to estimate
|