aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2016-05-26 03:01:51 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2016-05-26 00:31:51 +0300
commit7aa24c7d0a68959e4d29c41d157ee30ff97153ad (patch)
treedd2eb85b93794cba138e642343587e062b6b7474 /mesonbuild/compilers.py
parentdf03f849a8d52bb45677b17b2516f2257ea42dda (diff)
downloadmeson-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 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 241192e..458a579 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -755,7 +755,8 @@ int main(int argc, char **argv) {
# redefines the symbol to be something else. In that case, we want to
# still detect the function. We still want to fail if __stub_foo or
# _stub_foo are defined, of course.
- if self.links('{0}\n' + stubs_fail + '\nint main() {{ {1}; }}'.format(prefix, funcname), extra_args):
+ header_templ = '#include <limits.h>\n{0}\n' + stubs_fail + '\nint main() {{ {1}; }}'
+ if self.links(header_templ.format(prefix, funcname), extra_args):
return True
# Some functions like alloca() are defined as compiler built-ins which
# are inlined by the compiler, so test for that instead. Built-ins are