[FFmpeg-cvslog] r16555 - in trunk: configure libavutil/internal.h
ramiro
subversion
Sun Jan 11 23:10:04 CET 2009
Author: ramiro
Date: Sun Jan 11 23:10:04 2009
New Revision: 16555
Log:
Add truncf() replacement function.
Patch by Michael Kostylev <mik at it-1 dot ru>
Modified:
trunk/configure
trunk/libavutil/internal.h
Modified: trunk/configure
==============================================================================
--- trunk/configure Sun Jan 11 23:05:48 2009 (r16554)
+++ trunk/configure Sun Jan 11 23:10:04 2009 (r16555)
@@ -886,6 +886,7 @@ HAVE_LIST="
sys_videoio_h
termios_h
threads
+ truncf
winsock2_h
yasm
"
@@ -1875,7 +1876,7 @@ done
check_lib math.h sin -lm
# test for C99 functions in math.h
-for func in llrint lrint lrintf round roundf; do
+for func in llrint lrint lrintf round roundf truncf; do
check_exec <<EOF && enable $func || disable $func
#include <math.h>
int main(void) { return ($func(3.999f) > 0)?0:1; }
Modified: trunk/libavutil/internal.h
==============================================================================
--- trunk/libavutil/internal.h Sun Jan 11 23:05:48 2009 (r16554)
+++ trunk/libavutil/internal.h Sun Jan 11 23:10:04 2009 (r16555)
@@ -294,4 +294,11 @@ static av_always_inline av_const float r
}
#endif /* HAVE_ROUNDF */
+#ifndef HAVE_TRUNCF
+static av_always_inline av_const float truncf(float x)
+{
+ return (x > 0) ? floor(x) : ceil(x);
+}
+#endif /* HAVE_TRUNCF */
+
#endif /* AVUTIL_INTERNAL_H */
More information about the ffmpeg-cvslog
mailing list