[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 23/26] configure: convert CONFIG_STATIC_ASSERT tests to meson
From: |
Paolo Bonzini |
Subject: |
[PATCH 23/26] configure: convert CONFIG_STATIC_ASSERT tests to meson |
Date: |
Tue, 8 Jun 2021 13:22:58 +0200 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 18 ------------------
meson.build | 6 ++++++
2 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/configure b/configure
index 3e94ec0bd2..dd6098e306 100755
--- a/configure
+++ b/configure
@@ -4392,20 +4392,6 @@ then
fi
-##########################################
-# check for _Static_assert()
-
-have_static_assert=no
-cat > $TMPC << EOF
-_Static_assert(1, "success");
-int main(void) {
- return 0;
-}
-EOF
-if compile_prog "" "" ; then
- have_static_assert=yes
-fi
-
##########################################
# checks for sanitizers
@@ -5128,10 +5114,6 @@ if test "$have_af_vsock" = "yes" ; then
echo "CONFIG_AF_VSOCK=y" >> $config_host_mak
fi
-if test "$have_static_assert" = "yes" ; then
- echo "CONFIG_STATIC_ASSERT=y" >> $config_host_mak
-fi
-
if test "$debug_mutex" = "yes" ; then
echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
fi
diff --git a/meson.build b/meson.build
index 0b9dac5546..4b9bbca7ff 100644
--- a/meson.build
+++ b/meson.build
@@ -1318,6 +1318,12 @@ config_host_data.set('HAVE_STRUCT_STAT_ST_ATIM',
config_host_data.set('HAVE_UTMPX',
cc.has_header_symbol('utmpx.h', 'struct utmpx'))
+config_host_data.set('CONFIG_STATIC_ASSERT', cc.compiles('''
+ _Static_assert(1, "success");
+ int main(void) {
+ return 0;
+ }'''))
+
# Some versions of Mac OS X incorrectly define SIZE_MAX
config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''
#include <stdint.h>
--
2.31.1
- Re: [PATCH 15/26] meson: sort header tests, (continued)
[PATCH 12/26] configure, meson: convert libpmem detection to meson, Paolo Bonzini, 2021/06/08
[PATCH 20/26] meson: store dependency('threads') in a variable, Paolo Bonzini, 2021/06/08
[PATCH 17/26] configure, meson: move CONFIG_IVSHMEM to meson, Paolo Bonzini, 2021/06/08
[PATCH 21/26] configure: convert compiler tests to meson, part 2, Paolo Bonzini, 2021/06/08
[PATCH 23/26] configure: convert CONFIG_STATIC_ASSERT tests to meson,
Paolo Bonzini <=
[PATCH 22/26] configure: convert compiler tests to meson, part 3, Paolo Bonzini, 2021/06/08
[PATCH 26/26] configure: convert compiler tests to meson, part 6, Paolo Bonzini, 2021/06/08
[PATCH 25/26] configure: convert compiler tests to meson, part 5, Paolo Bonzini, 2021/06/08
[PATCH 19/26] configure: convert compiler tests to meson, part 1, Paolo Bonzini, 2021/06/08