mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
18 lines
633 B
Plaintext
18 lines
633 B
Plaintext
$NetBSD: patch-ac,v 1.2 2010/08/09 10:11:57 drochner Exp $
|
|
|
|
--- src/load-graph.cpp.orig 2009-06-23 00:03:02.000000000 +0000
|
|
+++ src/load-graph.cpp
|
|
@@ -411,8 +411,11 @@ net_scale (LoadGraph *g, unsigned din, u
|
|
//
|
|
// e.g: ceil(100.5 KiB) = 101 KiB = 101 * 2**(1 * 10)
|
|
// where base10 = 1, coef10 = 101, pow2 = 16
|
|
-
|
|
+#ifdef __FreeBSD__
|
|
+ unsigned pow2 = std::floor(log(new_max) / log(2));
|
|
+#else
|
|
unsigned pow2 = std::floor(log2(new_max));
|
|
+#endif
|
|
unsigned base10 = pow2 / 10;
|
|
unsigned coef10 = std::ceil(new_max / double(1UL << (base10 * 10)));
|
|
g_assert(new_max <= (coef10 * (1UL << (base10 * 10))));
|