gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 216/335: configure: added tests for 'unreachable' suppor


From: gnunet
Subject: [libmicrohttpd] 216/335: configure: added tests for 'unreachable' supported keywords
Date: Sat, 27 Jul 2024 22:01:52 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to tag stf-m2
in repository libmicrohttpd.

commit b3da38e9e50da6bdfd14aa1260d9e5061c211f21
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Jun 21 14:22:18 2024 +0200

    configure: added tests for 'unreachable' supported keywords
---
 configure.ac | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/configure.ac b/configure.ac
index ec532ce7..39798b5f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1321,6 +1321,47 @@ AS_IF([test "x$ac_cv_c_inline" != "xno" && test 
"x${mhd_cv_cc_kwd_forceinline}"
   [AC_DEFINE([MHD_static_inline_],[static inline],[Define to prefix which will 
be used with MHD static inline functions.])]
 )
 
+AC_CACHE_CHECK([for 'unreachable' keywords supported by 
$CC],[mhd_cv_cc_kwd_unreachable],
+  [
+    mhd_cv_cc_kwd_unreachable="none"
+    for keyword_chk in '__builtin_unreachable()' '__assume(0)' 'unreachable()'
+    do
+      AC_LINK_IFELSE([
+          AC_LANG_SOURCE([[
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
+int zero_if_positive(int val)
+{
+  if (val > 0)
+    return 0;
+  ${keyword_chk};
+  return 1;
+}
+
+int main(void)
+{
+  return zero_if_positive(1);
+}
+            ]]
+          )
+        ],
+        [mhd_cv_cc_kwd_unreachable="$keyword_chk"]
+      )
+      test "x${mhd_cv_cc_kwd_unreachable}" != "xnone" && break
+    done
+  ]
+)
+AS_IF([test "x${mhd_cv_cc_kwd_unreachable}" != "xnone"],
+  [
+    AC_DEFINE_UNQUOTED([MHD_UNREACHABLE_],[$mhd_cv_cc_kwd_unreachable],[Define 
to keyword used to indicate unreachable code paths])
+    AS_IF([test "x${mhd_cv_cc_kwd_unreachable}" = 'xunreachable()'],
+      
AC_DEFINE([MHD_UNREACHABLE_NEEDS_STDDEF_H],[$mhd_cv_cc_kwd_unreachable],[Define 
to '1' if MHD_UNREACHABLE_() requires include of <stddef.h> header])
+    )
+  ]
+)
+
 AC_CHECK_HEADERS([stdalign.h], [], [], [AC_INCLUDES_DEFAULT])
 AC_CACHE_CHECK([[for C11 'alignof()' support]], [[mhd_cv_c_alignof]],
   [AC_COMPILE_IFELSE(

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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