diff options
author | Simon McVittie <smcv@collabora.com> | 2019-05-10 16:50:57 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2019-05-10 16:52:11 +0100 |
commit | 744bd1824f3a2202ddb4683856a8750dd3cfe24d (patch) | |
tree | b9ea422ebd4636e0f64f30e85f62fbd76450b5d4 | |
parent | 170b105b5f65ebb3a8409fde8ae7e4f55c384946 (diff) | |
download | libglnx-744bd1824f3a2202ddb4683856a8750dd3cfe24d.tar.gz |
meson: Define HAVE_DECL_FOO to 0 if foo isn't declared
This matches what Autotools would do, and what our header is expecting.
It silences -Wundef.
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | meson.build | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/meson.build b/meson.build index d9abf37..73d2bc5 100644 --- a/meson.build +++ b/meson.build @@ -12,7 +12,7 @@ check_functions = [ ] conf = configuration_data() foreach check_function : check_functions - if cc.compiles(''' + have_it = cc.compiles(''' #include <sys/types.h> #include <unistd.h> #include <stdio.h> @@ -30,8 +30,7 @@ foreach check_function : check_functions args : '-D_GNU_SOURCE', name : check_function + '() is declared', ) - conf.set('HAVE_DECL_' + check_function.underscorify().to_upper(), 1) - endif + conf.set10('HAVE_DECL_' + check_function.underscorify().to_upper(), have_it) endforeach config_h = configure_file( output : 'config.h', |