diff --git a/configure b/configure index d0c00564ec..8041ca84c1 100755 --- a/configure +++ b/configure @@ -1189,6 +1189,19 @@ check_cpp_condition(){ EOF } +test_cflags_cpp(){ + log test_cflags_cpp "$@" + flags=$1 + condition=$2 + shift 2 + set -- $($cflags_filter "$flags") + check_cpp "$@" <= 201112L"; then + add_cflags -std=c11 +else + check_cflags -std=c99 +fi + check_cc -D_FILE_OFFSET_BITS=64 < EOF @@ -5569,6 +5591,11 @@ check_header windows.h check_header X11/extensions/XvMClib.h check_header asm/types.h +# it seems there are versions of clang in some distros that try to use the +# gcc headers, which explodes for stdatomic +# so we also check that atomics actually work here +check_builtin stdatomic_h stdatomic.h "atomic_int foo; atomic_store(&foo, 0)" + check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32 check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32 check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi