summaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-08-24 13:53:17 -0400
committerNick Mathewson <nickm@torproject.org>2011-08-24 13:53:17 -0400
commitede9cd4f99e4cd1c0c4bcf1a3ac994e87054cc2d (patch)
treee67b9ec15c18f7ab2a652866adcd134d9432727d /src/common/util.c
parentdd6a9a923d8bda5363c50d5ea7fd8ea403e895cd (diff)
parent5939c09d35de5be4b135bb0ad6dde24700e75fc2 (diff)
downloadtor-ede9cd4f99e4cd1c0c4bcf1a3ac994e87054cc2d.tar.gz
tor-ede9cd4f99e4cd1c0c4bcf1a3ac994e87054cc2d.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index c387318c0e..81d31f6026 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -335,7 +335,11 @@ tor_mathlog(double d)
long
tor_lround(double d)
{
+#ifdef _MSC_VER
+ return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5));
+#else
return lround(d);
+#endif
}
/** Returns floor(log2(u64)). If u64 is 0, (incorrectly) returns 0. */