mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Check for lround with autoconf; fall back to rint.
This commit is contained in:
+5
-3
@@ -334,10 +334,12 @@ tor_mathlog(double d)
|
||||
long
|
||||
tor_lround(double d)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5));
|
||||
#else
|
||||
#if defined(HAVE_LROUND)
|
||||
return lround(d);
|
||||
#elif defined(HAVE_RINT)
|
||||
return (long)rint(d);
|
||||
#else
|
||||
return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user