mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Check for lround with autoconf; fall back to rint.
This commit is contained in:
parent
03760f6c6f
commit
0ac4b0f99d
@ -223,7 +223,7 @@ dnl -------------------------------------------------------------------
|
||||
dnl Check for functions before libevent, since libevent-1.2 apparently
|
||||
dnl exports strlcpy without defining it in a header.
|
||||
|
||||
AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit strlcat strlcpy strtoull getaddrinfo localtime_r gmtime_r memmem strtok_r writev readv flock prctl vasprintf)
|
||||
AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit strlcat strlcpy strtoull getaddrinfo localtime_r gmtime_r memmem strtok_r writev readv flock prctl vasprintf lround rint)
|
||||
|
||||
using_custom_malloc=no
|
||||
if test x$enable_openbsd_malloc = xyes ; then
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user