Browse Source

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
tags/v0.5
Michael Kostylev Ramiro Polla 17 years ago
parent
commit
7b04b8a057
2 changed files with 9 additions and 1 deletions
  1. +2
    -1
      configure
  2. +7
    -0
      libavutil/internal.h

+ 2
- 1
configure View File

@@ -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; }


+ 7
- 0
libavutil/internal.h View File

@@ -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 */

Loading…
Cancel
Save