Fixes build failure on FreeBSD with gcc 4.7
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
EOF
}
-test_cflags_cpp(){
- log test_cflags_cpp "$@"
+test_cflags_cc(){
+ log test_cflags_cc "$@"
flags=$1
- condition=$2
- shift 2
+ header=$2
+ condition=$3
+ shift 3
set -- $($cflags_filter "$flags")
- check_cpp "$@" <<EOF
+ check_cc "$@" <<EOF
+#include <$header>
#if !($condition)
#error "unsatisfied condition: $condition"
#endif
# some compilers silently accept -std=c11, so we also need to check that the
# version macro is defined properly
-if test_cflags_cpp -std=c11 "__STDC_VERSION__ >= 201112L"; then
+if test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L"; then
add_cflags -std=c11
else
check_cflags -std=c99