diff options
author | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2016-05-26 03:01:51 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-05-26 00:31:51 +0300 |
commit | 7aa24c7d0a68959e4d29c41d157ee30ff97153ad (patch) | |
tree | dd2eb85b93794cba138e642343587e062b6b7474 /test cases | |
parent | df03f849a8d52bb45677b17b2516f2257ea42dda (diff) | |
download | meson-7aa24c7d0a68959e4d29c41d157ee30ff97153ad.zip meson-7aa24c7d0a68959e4d29c41d157ee30ff97153ad.tar.gz meson-7aa24c7d0a68959e4d29c41d157ee30ff97153ad.tar.bz2 |
compilers: Fix header stub change that broke has_function checks on Windows (#559)
Fixes https://github.com/mesonbuild/meson/issues/558
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/common/43 has function/meson.build | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test cases/common/43 has function/meson.build b/test cases/common/43 has function/meson.build index c7fe353..00ca640 100644 --- a/test cases/common/43 has function/meson.build +++ b/test cases/common/43 has function/meson.build @@ -9,7 +9,13 @@ endif # Should also be able to detect it without specifying the header # We check for a different function here to make sure the result is # not taken from a cache (ie. the check above) -assert(cc.has_function('fprintf'), '"fprintf" function not found without include (should always exist).') +# On MSVC fprintf is defined as an inline function in the header, so it cannot +# be found without the include. +if cc.get_id() != 'msvc' + assert(cc.has_function('fprintf'), '"fprintf" function not found without include (on !msvc).') +else + assert(cc.has_function('fprintf', prefix : '#include <stdio.h>'), '"fprintf" function not found with include (on msvc).') +endif if cc.has_function('hfkerhisadf', prefix : '#include<stdio.h>') error('Found non-existent function "hfkerhisadf".') |