qemu-devel
[Top][All Lists]
Advanced

[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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]