summaryrefslogtreecommitdiff
path: root/libavutil/libm.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavutil/libm.h')
-rw-r--r--libavutil/libm.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavutil/libm.h b/libavutil/libm.h
index 57eb0c0d6e..ef90df0384 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -33,9 +33,11 @@
#endif /* HAVE_MIPSFPU && HAVE_INLINE_ASM*/
#if !HAVE_CBRTF
-#undef cbrtf
-#define cbrtf(x) powf(x, 1.0/3.0)
-#endif /* HAVE_CBRTF */
+static av_always_inline float cbrtf(float x)
+{
+ return x < 0 ? -powf(-x, 1.0 / 3.0) : powf(x, 1.0 / 3.0);
+}
+#endif
#if !HAVE_EXP2
#undef exp2