Permalink
Browse files

build: fix detection of math functions with 2 parameters.

The code from libav seems to have been entirely untested.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information...
1 parent 2dbc934 commit 42ee9f3981979880209a60d1ac30057fcfab6e53 @michaelni michaelni committed Oct 24, 2012
Showing with 23 additions and 3 deletions.
  1. +23 −3 configure
View
@@ -860,6 +860,18 @@ int main(void){ return (int) foo; }
EOF
}
+check_math2func(){
+ log check_math2func "$@"
+ func=$1
+ shift
+ disable $func
+ check_ld "cc" "$@" <<EOF && enable $func
+#include <math.h>
+float foo(float f) { return $func(f, f); }
+int main(void){ return (int) foo; }
+EOF
+}
+
check_func_headers(){
log check_func_headers "$@"
headers=$1
@@ -1265,23 +1277,20 @@ HAVE_LIST_PUB='
MATH_FUNCS="
atanf
- atan2f
cbrtf
cosf
exp2
exp2f
expf
isinf
isnan
- ldexpf
llrint
llrintf
log2
log2f
log10f
lrint
lrintf
- powf
rint
round
roundf
@@ -1290,6 +1299,12 @@ MATH_FUNCS="
truncf
"
+MATH2_FUNCS="
+ atan2f
+ ldexpf
+ powf
+"
+
HAVE_LIST="
$ARCH_EXT_LIST
$(add_suffix _external $ARCH_EXT_LIST)
@@ -1298,6 +1313,7 @@ HAVE_LIST="
$HAVE_LIST_PUB
$THREADS_LIST
$MATH_FUNCS
+ $MATH2_FUNCS
aligned_malloc
aligned_stack
alsa_asoundlib_h
@@ -3633,6 +3649,10 @@ for func in $MATH_FUNCS; do
check_mathfunc $func
done
+for func in $MATH2_FUNCS; do
+ check_math2func $func
+done
+
# these are off by default, so fail if requested and not available
enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit

0 comments on commit 42ee9f3

Please sign in to comment.