On Tue, 10 Jul 2012, Diego Biurrun wrote:

On Tue, Jul 10, 2012 at 03:50:35PM +0300, Martin Storsjö wrote:
Diego Biurrun <di...@biurrun.de> wrote:
On Tue, Jul 10, 2012 at 02:55:01PM +0300, Martin Storsjö wrote:
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -86,6 +86,13 @@ static av_always_inline av_const int isnan(float
x)
 #define log2f(x) ((float)log2(x))
 #endif /* HAVE_LOG2F */

+#if !HAVE_RINT
+static inline double rint(double x)
+{
+    return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5);
+}
+#endif /* HAVE_RINT */
+
 #if !HAVE_LRINT
 static av_always_inline av_const long int lrint(double x)

order

No, it needs to be here, since the lrint fallback below uses it.

Then it needs to be even further up, there are more uses of rint
in that file.

The ones further up are macros, so the actual function doesn't need to be defined there yet, only once you use the macro. The ones below are inline functions though.

// Martin
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to