changeset 806:757914de10e1 libavutil

Add replacements for log2f(), exp2() and exp2f() for platforms that lacks it. Should fix build breakage on some platforms introduced in r21125.
author vitor
date Tue, 12 Jan 2010 02:19:51 +0000
parents 98783d518982
children 36cc11e07d9b
files internal.h
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/internal.h	Sun Jan 03 14:31:25 2010 +0000
+++ b/internal.h	Tue Jan 12 02:19:51 2010 +0000
@@ -263,6 +263,20 @@
     }\
 }
 
+#if !HAVE_EXP2
+static av_always_inline av_const double exp2(double x)
+{
+    return exp(x * 0.693147180559945);
+}
+#endif /* HAVE_EXP2 */
+
+#if !HAVE_EXP2F
+static av_always_inline av_const float exp2f(float x)
+{
+    return exp2(x);
+}
+#endif /* HAVE_EXP2F */
+
 #if !HAVE_LLRINT
 static av_always_inline av_const long long llrint(double x)
 {
@@ -277,6 +291,13 @@
 }
 #endif /* HAVE_LOG2 */
 
+#if !HAVE_LOG2F
+static av_always_inline av_const float log2f(float x)
+{
+    return log2(x);
+}
+#endif /* HAVE_LOG2F */
+
 #if !HAVE_LRINT
 static av_always_inline av_const long int lrint(double x)
 {