Browse code

Special check for math.h functions

These are often, contrary to standards, implemented only as macros
or compiler-builtin functions without an actual symbol definition.

Originally committed as revision 21734 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård authored on 2010/02/10 07:55:13
Showing 1 changed files
... ...
@@ -668,6 +668,17 @@ int main(void){ $func(); }
668 668
 EOF
669 669
 }
670 670
 
671
+check_mathfunc(){
672
+    log check_func "$@"
673
+    func=$1
674
+    shift
675
+    disable $func
676
+    check_ld "$@" <<EOF && enable $func
677
+#include <math.h>
678
+int main(void){ $func(0); return 0; }
679
+EOF
680
+}
681
+
671 682
 check_func_headers(){
672 683
     log check_func_headers "$@"
673 684
     headers=$1
... ...
@@ -2519,16 +2530,16 @@ done
2519 2519
 check_lib math.h sin -lm
2520 2520
 check_lib va/va.h vaInitialize -lva
2521 2521
 
2522
-check_func exp2
2523
-check_func exp2f
2524
-check_func llrint
2525
-check_func log2
2526
-check_func log2f
2527
-check_func lrint
2528
-check_func lrintf
2529
-check_func round
2530
-check_func roundf
2531
-check_func truncf
2522
+check_mathfunc exp2
2523
+check_mathfunc exp2f
2524
+check_mathfunc llrint
2525
+check_mathfunc log2
2526
+check_mathfunc log2f
2527
+check_mathfunc lrint
2528
+check_mathfunc lrintf
2529
+check_mathfunc round
2530
+check_mathfunc roundf
2531
+check_mathfunc truncf
2532 2532
 
2533 2533
 # these are off by default, so fail if requested and not available
2534 2534
 enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32