We were checking for builtins explicitly like this because the ordinary checks don't work for builtins at all. We do exactly the same check as Autoconf and it doesn't work with Autoconf either (Autoconf is broken!) So now we check for it in two ways: if there's no #include in prefix, we check if `__builtin_symbol` exists (has_function allows checking for functions without providing includes). If there's a #include, we check if `symbol` exists. The old method was causing problems with some buggy toolchains such as MSYS2 which define some builtins in the C library but don't expose them via headers which meant that `__builtin_symbol` would be found even though `symbol` is not available. Doing this allows people to always get the correct answer as long as they specify the includes that are required to find a function while also not forcing people to always specify includes to find a function which is cumbersome. Closes #1083pull/1095/head
parent
c75b5886da
commit
be04aa2a0b
2 changed files with 26 additions and 6 deletions
Loading…
Reference in new issue