Provide a fallback version of the libm function trunc
This fixes compilation on DOS. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
2
configure
vendored
2
configure
vendored
@@ -1119,6 +1119,7 @@ HAVE_LIST="
|
|||||||
sys_videoio_h
|
sys_videoio_h
|
||||||
ten_operands
|
ten_operands
|
||||||
threads
|
threads
|
||||||
|
trunc
|
||||||
truncf
|
truncf
|
||||||
vfp_args
|
vfp_args
|
||||||
VirtualAlloc
|
VirtualAlloc
|
||||||
@@ -2852,6 +2853,7 @@ check_mathfunc lrint
|
|||||||
check_mathfunc lrintf
|
check_mathfunc lrintf
|
||||||
check_mathfunc round
|
check_mathfunc round
|
||||||
check_mathfunc roundf
|
check_mathfunc roundf
|
||||||
|
check_mathfunc trunc
|
||||||
check_mathfunc truncf
|
check_mathfunc truncf
|
||||||
|
|
||||||
# these are off by default, so fail if requested and not available
|
# these are off by default, so fail if requested and not available
|
||||||
|
@@ -86,6 +86,13 @@ static av_always_inline av_const float roundf(float x)
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_ROUNDF */
|
#endif /* HAVE_ROUNDF */
|
||||||
|
|
||||||
|
#if !HAVE_TRUNC
|
||||||
|
static av_always_inline av_const double trunc(double x)
|
||||||
|
{
|
||||||
|
return (x > 0) ? floor(x) : ceil(x);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_TRUNC */
|
||||||
|
|
||||||
#if !HAVE_TRUNCF
|
#if !HAVE_TRUNCF
|
||||||
static av_always_inline av_const float truncf(float x)
|
static av_always_inline av_const float truncf(float x)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user