summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2013-01-22 04:10:21 -0300
committerMichael Niedermayer <michaelni@gmx.at>2013-01-22 16:02:31 +0100
commite65d8509f0657810511b96f2eec43b7cf31434e9 (patch)
tree05ad02b23820ddc3ce883c4b2e260358040596df /libavutil
parent26345acb0e723d28aa28e09126ea383b2f679f5b (diff)
downloadffmpeg-e65d8509f0657810511b96f2eec43b7cf31434e9.tar.gz
libm: Add fallback definition for cbrt() using pow()
The function is known to be missing in at least one target (MSVC). Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 bfcc21c5da..6c17b287b4 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -48,6 +48,13 @@
#define powf(x, y) ((float)pow(x, y))
#endif
+#if !HAVE_CBRT
+static av_always_inline double cbrt(double x)
+{
+ return x < 0 ? -pow(-x, 1.0 / 3.0) : pow(x, 1.0 / 3.0);
+}
+#endif
+
#if !HAVE_CBRTF
static av_always_inline float cbrtf(float x)
{