summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-04-21 13:02:38 +0200
committerMartin Storsjö <martin@martin.st>2011-04-21 14:13:09 +0300
commit23d3931a6a8a37bb7e86bd6cb4709eb46031bfe1 (patch)
treed11e8281215886b7ce648bd5f7fd115a8cba8638 /libavutil
parent32a128522ad392d2bca67165fda1d2fe30262189 (diff)
downloadffmpeg-23d3931a6a8a37bb7e86bd6cb4709eb46031bfe1.tar.gz
Provide a fallback version of the libm function trunc
This fixes compilation on DOS. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/libm.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavutil/libm.h b/libavutil/libm.h
index 704bcf9554..783f3cdfab 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -86,6 +86,13 @@ static av_always_inline av_const float roundf(float x)
}
#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
static av_always_inline av_const float truncf(float x)
{