summaryrefslogtreecommitdiff
path: root/test cases/common/43 has function
AgeCommit message (Collapse)Author
2018-08-19Condense test dirs.Jussi Pakkanen
2017-01-26compilers: Don't run built-in checks on MSVCNirbheek Chauhan
MSVC does not have built-ins, so this is totally useless. Instead, add a test for intrinsics to ensure that we do find them.
2017-01-26compilers: Fix has_function check for builtinsNirbheek Chauhan
Use a single check for both cases when we have includes and when we don't. This way we ensure three things: 1. Built-in checks are 100% reliable with clang and on macOS since clang implements __has_builtin 2. When the #include is present, this ensures that __builtin_func is not checked for (because of MSYS, and because it is faster) 3. We fallback to checking __builtin_func when all else fails
2017-01-26compilers: Fix builtin checks with clang on LinuxNirbheek Chauhan
Our "43 has function" test should also work with clang and icc on Linux, so enable them. Also detect builtins with __has_builtin if available, which is much faster on clang. There is a feature request for the same with GCC too: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66970
2016-12-10has_function: Fix checking for builtins with includesNirbheek Chauhan
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 #1083
2016-12-04Compiler check and extra args should always overrideNirbheek Chauhan
We want compiler check arguments (-O0, -fpermissive, etc) to override all other arguments, and we want extra_args passed in by the build file to always override everything. To do this properly, we must split include arguments out, append them first, append all other arguments as usual, and then append the rest. As part of this, we also add the compiler check flags to the cc.compiles() and cc.links() helper functions since they also most likely need them. Also includes a unit test for all this.
2016-11-08tests/common: Run compiler checks for both C & C++Nirbheek Chauhan
Without this we're just hoping that the C++ compiler behaves the same way as the C compiler, which is not always true as demonstrated by https://github.com/mesonbuild/meson/issues/958
2016-05-26compilers: Fix header stub change that broke has_function checks on Windows ↵Nirbheek Chauhan
(#559) Fixes https://github.com/mesonbuild/meson/issues/558
2016-05-04tests/common/43: Better, more descriptive error messagesNirbheek Chauhan
2016-04-07Improve cc.has_function() check to not require any includes and detect stubsTim-Philipp Müller
We now use .links() to detect if a C compiler function is available or not, that way the user doesn't need to specify all the possible includes for the check, which simplifies things considerably. Also detect glibc stub functions that will never work and return false for them. Closes #437
2013-07-30Forgot this one.Jussi Pakkanen