Skip to content
Snippets Groups Projects
Commit 5939c09d authored by Gisle Vanem's avatar Gisle Vanem Committed by Nick Mathewson
Browse files

lround() missing in MSVC

lround() is missing in MS Visual-C's <math.h>. Not available anywhere.
Here is an easy patch.
parent d79d648e
No related branches found
No related tags found
No related merge requests found
o Build fixes:
- Provide a substitute implementation of lround() for MSVC, which
apparently lacks it. Patch from Gisle Vanem.
......@@ -334,7 +334,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. */
......
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