aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-05-25 23:40:44 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-05-25 23:40:44 +0300
commit8119207ee28bf22f9b0a99c26eced01d40bb3251 (patch)
treee2744e51370b8a037b00dec228d1d3f26cb7682a
parentd8e08224da6045460879068fd07cc3f6c6d3fc51 (diff)
parent4578e116182c3bc972b770a9cbdf69749dc234f9 (diff)
downloadmeson-8119207ee28bf22f9b0a99c26eced01d40bb3251.zip
meson-8119207ee28bf22f9b0a99c26eced01d40bb3251.tar.gz
meson-8119207ee28bf22f9b0a99c26eced01d40bb3251.tar.bz2
Merge pull request #547 from centricular/limits-h_needed_for_stubs
compilers: Always include limits.h to make the stub machinery work
-rw-r--r--mesonbuild/compilers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 25eefc6..8a25b18 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -692,6 +692,7 @@ int main(int argc, char **argv) {
# Then, undef the symbol to get rid of it completely.
templ = '''
#define {1} meson_disable_define_of_{1}
+ #include <limits.h>
{0}
#undef {1}
'''
@@ -709,6 +710,8 @@ int main(int argc, char **argv) {
# glibc defines functions that are not available on Linux as stubs that
# fail with ENOSYS (such as e.g. lchmod). In this case we want to fail
# instead of detecting the stub as a valid symbol.
+ # We always include limits.h above to ensure that these are defined for
+ # stub functions.
stubs_fail = '''
#if defined __stub_{1} || defined __stub___{1}
fail fail fail this function is not going to work