mirror of
https://github.com/librempeg/librempeg
synced 2024-11-22 09:02:20 +00:00
configure: Check for the math function rint
Add a fallback implementation if it doesn't exist. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
781888da89
commit
183b1c2268
2
configure
vendored
2
configure
vendored
@ -1124,6 +1124,7 @@ HAVE_LIST="
|
||||
poll_h
|
||||
posix_memalign
|
||||
rdtsc
|
||||
rint
|
||||
round
|
||||
roundf
|
||||
rweflags
|
||||
@ -2954,6 +2955,7 @@ check_mathfunc log2
|
||||
check_mathfunc log2f
|
||||
check_mathfunc lrint
|
||||
check_mathfunc lrintf
|
||||
check_mathfunc rint
|
||||
check_mathfunc round
|
||||
check_mathfunc roundf
|
||||
check_mathfunc trunc
|
||||
|
@ -86,6 +86,13 @@ static av_always_inline av_const int isnan(float x)
|
||||
#define log2f(x) ((float)log2(x))
|
||||
#endif /* HAVE_LOG2F */
|
||||
|
||||
#if !HAVE_RINT
|
||||
static inline double rint(double x)
|
||||
{
|
||||
return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5);
|
||||
}
|
||||
#endif /* HAVE_RINT */
|
||||
|
||||
#if !HAVE_LRINT
|
||||
static av_always_inline av_const long int lrint(double x)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user