[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.
- [libmicrohttpd] 194/335: GENERATED: fixed macro names instead of enum values, (continued)
- [libmicrohttpd] 194/335: GENERATED: fixed macro names instead of enum values, gnunet, 2024/07/27
- [libmicrohttpd] 206/335: configure: renamed _MHD_NORETURN -> MHD_NORETURN_, gnunet, 2024/07/27
- [libmicrohttpd] 219/335: configure: improved testing for supported function attributes, gnunet, 2024/07/27
- [libmicrohttpd] 218/335: configure: added checks for sokets-related symbols declarations, gnunet, 2024/07/27
- [libmicrohttpd] 222/335: this_API_is_TERRIBLE: even more, gnunet, 2024/07/27
- [libmicrohttpd] 189/335: GENERATED: use correct function attributes, gnunet, 2024/07/27
- [libmicrohttpd] 205/335: configure: supported C23 'noreturn' keyword, gnunet, 2024/07/27
- [libmicrohttpd] 215/335: configure: added support for 'restrict', gnunet, 2024/07/27
- [libmicrohttpd] 226/335: -fix typo, gnunet, 2024/07/27
- [libmicrohttpd] 223/335: Initial draft M2 (WIP), gnunet, 2024/07/27
- [libmicrohttpd] 216/335: configure: added tests for 'unreachable' supported keywords,
gnunet <=
- [libmicrohttpd] 217/335: configure: added checks for socketpair(), gnunet, 2024/07/27
- [libmicrohttpd] 209/335: this_API_is_TERRIBLE.txt: updated, gnunet, 2024/07/27
- [libmicrohttpd] 230/335: w32_lib_res.rc.in: fixed, gnunet, 2024/07/27
- [libmicrohttpd] 229/335: Partial revert of 7237eb207b6dd215c5b726ed4b2a1e337cc4dbcc, gnunet, 2024/07/27
- [libmicrohttpd] 220/335: configure: added tests for supported enum attributes, gnunet, 2024/07/27
- [libmicrohttpd] 203/335: configure: check for more network/sockets headers, gnunet, 2024/07/27
- [libmicrohttpd] 232/335: -fix build error: SO_ERROR on some platforms, gnunet, 2024/07/27
- [libmicrohttpd] 221/335: GENERATED: more edits, gnunet, 2024/07/27
- [libmicrohttpd] 227/335: -fix typo, gnunet, 2024/07/27
- [libmicrohttpd] 228/335: -fix typo, gnunet, 2024/07/27