[FFmpeg-devel] [PATCH] lavu/libm: add isfinite fallback

Ganesh Ajjanagadde gajjanagadde at gmail.com
Thu Jan 14 01:10:16 CET 2016


Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 configure        | 1 +
 libavutil/libm.h | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/configure b/configure
index 415d939..a3aaa25 100755
--- a/configure
+++ b/configure
@@ -1821,6 +1821,7 @@ MATH_FUNCS="
     exp2f
     expf
     hypot
+    isfinite
     isinf
     isnan
     ldexpf
diff --git a/libavutil/libm.h b/libavutil/libm.h
index bc44dca..f01e5c6 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -343,6 +343,10 @@ static av_always_inline av_const int avpriv_isnan(double x)
         : avpriv_isnan(x))
 #endif /* HAVE_ISNAN */
 
+#if !HAVE_ISFINITE
+#define isfinite(x) (!(isinf(x) || isnan(x)))
+#endif /* HAVE_ISFINITE */
+
 #if !HAVE_HYPOT
 static inline av_const double hypot(double x, double y)
 {
-- 
2.7.0



More information about the ffmpeg-devel mailing list