lrintf detection (based upon a patch by François Revol <revol at free dot fr>)
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 5 Nov 2002 00:07:05 +0000 (00:07 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 5 Nov 2002 00:07:05 +0000 (00:07 +0000)
Originally committed as revision 1162 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure
libavcodec/dsputil.h

index 5a36eca825d8d906d54e11eaac07c7f2f2efc5b0..d4e6134f9d4eea3da419b6ca8226eb6f0b584302 100755 (executable)
--- a/configure
+++ b/configure
@@ -360,6 +360,19 @@ if test "$zlib" = "yes"; then
 extralibs="$extralibs -lz"
 fi
 
+# test for lrintf in math.h
+cat > $TMPC << EOF
+#define _ISOC9X_SOURCE  1
+#include <math.h>
+int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
+EOF
+
+have_lrintf="no"
+if $cc $extralibs -o $TMPO $TMPC 2> /dev/null ; then
+  have_lrintf="yes"
+  $TMPO 2> /dev/null > /dev/null || have_lrintf="no"
+fi
+
 _restrict=
 for restrict_keyword in restrict __restrict__ __restrict; do
   echo "void foo(char * $restrict_keyword p);" > $TMPC
@@ -496,6 +509,9 @@ fi
 if test "$imlib2" = "yes" ; then
   echo "HAVE_IMLIB2=yes" >> config.mak
 fi
+if test "$have_lrintf" = "yes" ; then
+  echo "#define HAVE_LRINTF 1" >> $TMPH
+fi
 if test "$vhook" = "yes" ; then
   echo "BUILD_VHOOK=yes" >> config.mak
   echo "#define HAVE_VHOOK 1" >> $TMPH
index 4507753a875c500658352ad92db0fd5917ce9eda..3f9b5893d857b88c63b9fe8273555cd8bab897c0 100644 (file)
@@ -269,7 +269,7 @@ void ff_mdct_calc(MDCTContext *s, FFTSample *out,
                const FFTSample *input, FFTSample *tmp);
 void ff_mdct_end(MDCTContext *s);
 
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
+#ifndef HAVE_LRINTF
 /* XXX: add ISOC specific test to avoid specific BSD testing. */
 /* better than nothing implementation. */
 /* btw, rintf() is existing on fbsd too -- alex */