diff options
author | Michael Kostylev <michael.kostylev@gmail.com> | 2009-01-11 22:10:04 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2009-01-11 22:10:04 +0000 |
commit | 7b04b8a0578a29f6403a8da74a94d1015c51c7ab (patch) | |
tree | dd4cc8728a935ac0c6e2e3d8823292a2f05d54ba /libavutil/internal.h | |
parent | b9609848f359d2cfc6a483d0557421427a878039 (diff) | |
download | ffmpeg-streaming-7b04b8a0578a29f6403a8da74a94d1015c51c7ab.zip ffmpeg-streaming-7b04b8a0578a29f6403a8da74a94d1015c51c7ab.tar.gz |
Add truncf() replacement function.
Patch by Michael Kostylev <mik at it-1 dot ru>
Originally committed as revision 16555 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r-- | libavutil/internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h index bbf4407..9575660 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -294,4 +294,11 @@ static av_always_inline av_const float roundf(float x) } #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 */ |